Distributed storage system testing method and device, equipment and storage medium
By creating a test scenario library and generating random test parameters, dynamically adjusting the weights and parameters of the test scenarios, the problem that existing testing methods are difficult to fully cover complex business scenarios is solved, and efficient, comprehensive and automated distributed storage system testing is achieved, improving testing efficiency and accuracy.
Patent Information
- Application Number
- CN202411980821.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-11
Smart Images

Figure CN119806933A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a distributed storage system testing method, device, equipment and storage medium. Background Art
[0002] With the rapid development of cloud computing and big data technology, distributed storage systems have become the core architecture of modern data processing and storage due to their high scalability, high availability and high fault tolerance. However, with the increasing complexity of distributed storage systems, business scenarios usually involve a large number of complex processes such as data read and write operations, data migration, data backup and recovery, and data consistency verification. These processes may cause a series of unexpected problems under specific business models, such as high concurrent writes, uneven distribution of data hotspots, and node failures, such as data loss, data inconsistency, performance degradation, and even system crashes. These problems not only affect user experience, but may also cause significant economic losses and reputation damage to the company.
[0003] Existing testing methods and tools, such as unit testing, integration testing, stress testing, and fault injection testing, often have the following shortcomings when dealing with complex business scenarios of distributed storage: 1. Fixed test cases. Traditional test cases are often written based on preset scenarios and parameters, and it is difficult to fully cover all possible business scenarios and abnormal situations. Especially for those extreme or rare business scenarios, the coverage of traditional test cases is often low; 2. Limitations of test scenarios. Existing testing tools and methods focus on basic function verification, and pay insufficient attention to behavioral patterns and potential problems in specific business scenarios, resulting in some hidden problems being difficult to discover in time; 3. Testing efficiency and cost. With the continuous expansion of the scale of distributed storage systems and the increasing complexity of business scenarios, the traditional method of manually writing and executing test cases can no longer meet testing needs, which not only increases testing costs but also reduces testing efficiency. Summary of the invention
[0004] Based on this, it is necessary to provide a distributed storage system testing method, device, computer equipment and storage medium that can perform efficient and comprehensive testing on complex and changeable business scenarios in response to the above technical problems.
[0005] In one aspect, a distributed storage system testing method is provided, the method comprising:
[0006] Creating a test scenario library according to the business model of the distributed storage system;
[0007] Determining a target test scenario from the test scenario library based on the current weight of each test scenario, and generating a target test parameter according to a preset parameter range of the target test scenario;
[0008] Generate a test case according to the target test parameter, and execute the test case on the distributed storage system to obtain a test result;
[0009] In response to the test result not satisfying a preset condition, the current parameter value and the current weight value of the target test scenario in the test scenario library are updated according to the target test parameter, and the updated test scenario library is iteratively tested until a termination condition is satisfied.
[0010] In one embodiment, the step of creating a test scenario library according to the business model of the distributed storage system includes:
[0011] Obtain a business model of the distributed storage system, and build a test scenario according to the business model, wherein the parameters of the business model include one or more of storage file size, number of storage files, number of directories, directory depth, IO size, read-write ratio, random ratio, and concurrency number;
[0012] Set parameter ranges for each test scenario and create a test scenario library.
[0013] In one embodiment, determining a target test scenario from the test scenario library based on the current weight of each test scenario, and generating a target test parameter according to a parameter range of the target test scenario, includes:
[0014] Based on the current weights of the test scenarios, determining a target test scenario from the test scenario library by a random number generator;
[0015] In response to performing a test on the target test scenario for the first time, obtaining a parameter range of the target test scenario, and randomly generating a first test parameter within the parameter range as the target test parameter;
[0016] In response to not performing a test on the target test scenario for the first time, a current parameter value of the target test scenario is acquired, and the current parameter value is adjusted according to a preset adjustment strategy to generate a second test parameter as the target test parameter.
[0017] In one of the embodiments, in response to not performing the test on the target test scenario for the first time, obtaining the current parameter value of the target test scenario, and adjusting the current parameter value according to a preset adjustment strategy to generate a second test parameter as the target test parameter, includes:
[0018] In response to obtaining a second test result by performing a test on the target test scenario not for the first time, obtaining a current parameter value of the target test scenario, and a test parameter and a test result of a previous test of the target test scenario;
[0019] In response to a test result of a previous test of the target test scenario not satisfying a preset condition, calculating a change rate according to the second test result and the test result of the previous test;
[0020] A target step length is determined according to the change rate, and the current parameter value is adjusted according to the target step length to generate a second test parameter.
[0021] In one embodiment, the test result includes one or more of bandwidth, input / output volume per second, and delay; in response to the test result not satisfying a preset condition, updating a current parameter value and a current weight value of the target test scenario in the test scenario library according to the target test parameter, comprises:
[0022] In response to obtaining a first test result by performing a test on the target test scenario for the first time, comparing the first test result with the preset conditions respectively, wherein the first test result is obtained based on the first test parameter;
[0023] In response to any type of data in the first test result not reaching the index value corresponding to the preset condition, determining that the first test result does not meet the preset condition;
[0024] updating the current parameter value of the target test scenario according to the parameter value of the first test parameter, and increasing the current weight value of the target test scenario;
[0025] In response to obtaining a second test result by performing a test on the target test scenario not for the first time, comparing the second test result with the test result of a previous test, wherein the second test result is obtained based on the second test parameter;
[0026] In response to the presence of any type of data in the second test result not reaching a corresponding data value in the test result of the previous test, determining that the second test result does not meet a preset condition;
[0027] The current parameter value of the target test scenario is updated according to the parameter value of the second test parameter, and the current weight value of the target test scenario is increased.
[0028] In one embodiment, the method further comprises:
[0029] In response to all data in the test result reaching the index value corresponding to the preset condition or the data value corresponding to the test result of the previous test, determining that the test result meets the preset condition;
[0030] The current parameter values of the target test scenario are retained, and the current weight value of the target test scenario is reduced.
[0031] In one embodiment, the iterative testing of the updated test scenario library until a termination condition is met includes:
[0032] Determining a new target test scenario from the test scenario library according to the updated weight, and performing a test on the new target test scenario;
[0033] In response to reaching a preset number of tests, or detecting that a failure occurs in the distributed storage system, the test is terminated and a test report is output.
[0034] In another aspect, a distributed storage system testing device is provided, the device comprising:
[0035] A construction module, used to create a test scenario library according to the business model of the distributed storage system;
[0036] A generating module, configured to determine a target test scenario from the test scenario library based on current weights of the test scenarios, and to generate target test parameters according to a preset parameter range of the target test scenario;
[0037] A test module, used to generate a test case according to the target test parameters, and execute the test case on the distributed storage system to obtain a test result;
[0038] An updating module is used to update the current parameter value and the current weight value of the target test scenario in the test scenario library according to the target test parameter in response to the test result not satisfying the preset condition, and iteratively test the updated test scenario library until the termination condition is satisfied.
[0039] In another aspect, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the following steps are implemented:
[0040] Creating a test scenario library according to the business model of the distributed storage system;
[0041] Determining a target test scenario from the test scenario library based on the current weight of each test scenario, and generating a target test parameter according to a preset parameter range of the target test scenario;
[0042] Generate a test case according to the target test parameter, and execute the test case on the distributed storage system to obtain a test result;
[0043] In response to the test result not satisfying a preset condition, the current parameter value and the current weight value of the target test scenario in the test scenario library are updated according to the target test parameter, and the updated test scenario library is iteratively tested until a termination condition is satisfied.
[0044] In another aspect, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0045] Creating a test scenario library according to the business model of the distributed storage system;
[0046] Determining a target test scenario from the test scenario library based on the current weight of each test scenario, and generating a target test parameter according to a preset parameter range of the target test scenario;
[0047] Generate a test case according to the target test parameter, and execute the test case on the distributed storage system to obtain a test result;
[0048] In response to the test result not satisfying a preset condition, the current parameter value and the current weight value of the target test scenario in the test scenario library are updated according to the target test parameter, and the updated test scenario library is iteratively tested until a termination condition is satisfied.
[0049] The above-mentioned distributed storage system testing method, device, computer equipment and storage medium can cover more possible business scenarios and abnormal situations by creating a test scenario library and randomly generating test parameters, and by dynamically adjusting weights, those test scenarios that may have potential problem points can get more testing opportunities, thereby simulating extreme situations in the actual operating environment and improving the comprehensiveness and effectiveness of the test. The entire testing process is highly automated, reducing manual intervention, improving testing efficiency and accuracy, and at the same time, through continuous iteration and optimization of test cases, the depth and breadth of the test can be continuously improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 A schematic diagram of a distributed storage system testing method in one embodiment;
[0051] Figure 2 It is a flowchart of a distributed storage system testing method in another embodiment;
[0052] Figure 3 is a structural block diagram of a distributed storage system testing device in one embodiment;
[0053] Figure 4 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0054] 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.
[0055] In one embodiment, Figure 1-2 As shown, a distributed storage system testing method is provided, comprising the following steps:
[0056] Step S1, creating a test scenario library according to the business model of the distributed storage system.
[0057] In one embodiment, creating a test scenario library based on the business model of the distributed storage system includes: obtaining the business model of the distributed storage system, and constructing a test scenario based on the business model, wherein the parameters of the business model include one or more of storage file size, number of storage files, number of directories, directory depth, IO size, read-write ratio, random ratio and concurrency number; setting the parameter range of each test scenario and creating a test scenario library.
[0058] Different test scenarios can be designed according to the business characteristics of the distributed storage system. Each test scenario is used to simulate a specific business operation or process, such as high-concurrency writing, data migration, etc. Then, a set of adjustable test parameters and their default parameter values are defined for each test scenario, and the test results of each test scenario under the default parameter values are recorded as a benchmark for subsequent comparisons. In addition, the same initial weight value is assigned to all test scenarios to ensure that at the beginning of the test, the probability of each test scenario being selected is equal.
[0059] For example, for the test scenario of image business, the parameter range can be set to a storage file size of less than 20MB, a storage file number of 100,000, and a read-write ratio of 5:5; for the test scenario of video business, the parameter range can be set to a storage file size of 100MB-100GB, a storage file number of 10,000, and a read-write ratio of 2:8; for the test scenario of office document archiving, the parameter range can be set to a storage file size of less than 10MB, a storage file number of more than 1 million, and a read-write ratio of 1:9.
[0060] It should be noted that the test scenarios shown above are only a few examples. In actual applications, they are not limited to the above test scenarios and the above parameter ranges. Other test scenarios and corresponding parameters can be set according to business requirements, which are not listed here one by one.
[0061] Step S2, determining a target test scenario from the test scenario library based on the current weight of each test scenario, and generating target test parameters according to a preset parameter range of the target test scenario.
[0062] In one embodiment, the target test scenario is determined from the test scenario library based on the current weight of each test scenario, and the target test parameter is generated according to the parameter range of the target test scenario, including: based on the current weight of each test scenario, the target test scenario is determined from the test scenario library by a random number generator; in response to the first test performed on the target test scenario, the parameter range of the target test scenario is obtained, and a first test parameter is randomly generated within the parameter range as the target test parameter; in response to not the first test performed on the target test scenario, the current parameter value of the target test scenario is obtained, and the current parameter value is adjusted according to a preset adjustment strategy to generate a second test parameter as the target test parameter.
[0063] Among them, the initial weight of each test scenario in the test scenario library defaults to 1, which means that when the test starts, the probability of each test scenario being selected is equal. The current weight value of the test scenario is subsequently adjusted according to the test results, so that test scenarios with poor performance have more testing opportunities.
[0064] Specifically, when the target test scenario is selected for the first time, the test parameters are randomly generated within the parameter range specified by the scenario. Then, in the subsequent test process, when the scenario is selected for the test again, random adjustments are made based on the current parameter values. This can be achieved by randomly selecting parameter values within a certain floating range above and below the current parameter value, or by mutating the parameter values according to preset mutation rules. The range of random adjustments during the entire test process will not exceed the parameter range limit of the scenario. By dynamically generating a variety of test scenarios and parameter combinations, it is ensured that each test uses test cases with different parameters, thereby covering a variety of possible states of the distributed storage system in different business scenarios, thereby significantly improving the coverage and comprehensiveness of the test.
[0065] In one embodiment, in response to performing a test on the target test scenario not for the first time, obtaining a current parameter value of the target test scenario, and adjusting the current parameter value according to a preset adjustment strategy to generate a second test parameter as the target test parameter, includes: in response to performing a test on the target test scenario not for the first time to obtain a second test result, obtaining the current parameter value of the target test scenario, and the test parameters and test results of a previous test of the target test scenario; in response to the test result of the previous test of the target test scenario not meeting a preset condition, calculating a rate of change based on the second test result and the test result of the previous test; determining a target step size based on the rate of change, and adjusting the current parameter value based on the target step size to generate a second test parameter as the target test parameter.
[0066] Specifically, an initial step size, a step size adjustment factor and a step size range are set for each parameter; the change rate is compared with a preset threshold; in response to the change rate being less than a preset first threshold, the current step size is adjusted according to the increase factor to obtain a first step size as the target step size; according to the first step size, the current parameter value is adjusted to generate a second test parameter; in response to the change rate being greater than or equal to the preset first threshold and less than a preset second threshold, the current step size is kept unchanged, and the current parameter value is adjusted according to the current step size to generate a second test parameter; in response to the change rate being greater than or equal to the preset second threshold, the current step size is adjusted according to the reduction factor to obtain a second step size as the target step size; according to the second step size, the current parameter value is adjusted to generate a second test parameter.
[0067] Exemplarily, the initial step size can be set to 10% of its parameter range, the reduction factor is 0.5, the increase factor is 1.5, and the minimum step size is 1% of its parameter range. The maximum value is 20% of its parameter range. Assuming the first threshold is 1% and the second threshold is 5%, when the bandwidth change rate is less than 1%, it indicates that the change of the second test parameter has little effect on the system performance. At this time, a larger step size is used for rapid exploration to find the parameter interval that may cause the system performance to degrade; when the bandwidth change rate is greater than or equal to 1% and less than 5%, the step size is gradually reduced to conduct a more detailed exploration of the discovered performance sensitive interval; when the bandwidth change rate is greater than or equal to 5%, it indicates that the change of the second test parameter has a significant impact on the system performance. A very small step size is used to accurately locate the performance limit point, thereby achieving efficient and comprehensive testing of the distributed storage system.
[0068] It is understandable that the step size may be adjusted when the change rate is less than or greater than a preset threshold for a certain number of times.
[0069] Step S3, generating a test case according to the target test parameters, and executing the test case on the distributed storage system to obtain a test result.
[0070] Specifically, the test case containing the target test parameters is sent to the client of the distributed storage system for execution, where the client can be an actual storage node or a test environment for simulating storage behavior. After receiving the test case, the corresponding client performs the corresponding business operations according to the instructions in the test case, and records the key data in the execution process as the test result, such as response time, throughput, error rate, bandwidth, latency, IOPS, etc. After the test case is executed, the client returns the test result to the control end.
[0071] For example, for the test scenario of the image service, the target test parameters are storage file size of 10MB, storage file number of 80,000, and read-write ratio of 5:5, then 80,000 10MB image files with a 5:5 read-write ratio is a corresponding test case. Since all the test parameters of the test scenario are randomly generated each time, it is equivalent to generating a certain test case for the test scenario each time.
[0072] Step S4, in response to the test result not satisfying the preset condition, updating the current parameter value and the current weight value of the target test scenario in the test scenario library according to the target test parameter, and iteratively testing the updated test scenario library until the termination condition is satisfied.
[0073] In one embodiment, the test result includes one or more of bandwidth, input and output volume per second, and latency; in response to the test result not satisfying the preset condition, updating the current parameter value and the current weight value of the target test scenario in the test scenario library according to the target test parameter, including: in response to obtaining a first test result in response to executing the test on the target test scenario for the first time, comparing the first test result with the preset condition respectively, wherein the first test result is obtained based on the first test parameter; in response to the presence of any type of data in the first test result that does not reach the corresponding indicator value in the preset condition, determining that the first test result does not satisfy the preset condition; and The parameter value of the first test parameter updates the current parameter value of the target test scenario, and increases the current weight value of the target test scenario; in response to obtaining a second test result in a non-first test execution of the target test scenario, the second test result is compared with the test results of the previous test, wherein the second test result is obtained based on the second test parameter; in response to the presence of any type of data in the second test result that does not reach the corresponding data value in the test result of the previous test, it is determined that the second test result does not meet the preset condition; according to the parameter value of the second test parameter, the current parameter value of the target test scenario is updated, and the current weight value of the target test scenario is increased.
[0074] Specifically, each test scenario is set with a default parameter value. When the target test scenario is tested for the first time, the control end compares and analyzes the test results of this test with the test results of the scenario under the default parameter values to evaluate the impact of changes in test parameters on system performance and behavior. If the test results of this test show that the system performs poorly in some aspects, such as performance degradation, increased error rate, etc., the built-in test parameters and test results of the current test scenario are updated to the parameter values and results of this test, which helps subsequent tests focus more on potential problem areas. During subsequent testing, when the target test scenario is selected for testing again, the parameter adjustment range is determined based on the test results of the previous test, and the parameters are adjusted in a direction that makes the test results worse.
[0075] In one embodiment, in response to all data in the test results reaching the corresponding indicator value in the preset condition or the corresponding data value in the test result of the previous test, it is determined that the test result meets the preset condition; the current parameter value of the target test scenario is retained, and the current weight value of the target test scenario is reduced.
[0076] Specifically, the weight value of the test scenario is adjusted according to the quality of the test results. If a test scenario performs poorly or causes problems in the test, its weight is increased to increase the probability of being selected again in the subsequent test process; conversely, if a test scenario performs stably during the test, its weight is appropriately reduced to reduce the probability of being selected in the subsequent test. Among them, the specific weight adjustment can be set according to the actual application and is not limited here. By intelligently adjusting the weights and parameters of the test scenarios, the problem areas of the system can be located more accurately, and targeted tests can be performed, thereby improving the effectiveness and accuracy of the test.
[0077] In one embodiment, the iterative testing of the updated test scenario library until the termination condition is met includes: determining a new target test scenario from the test scenario library according to the updated weight, and performing a test on the new target test scenario; in response to reaching a preset number of tests, or detecting that a failure of the distributed storage system has occurred, terminating the test and outputting a test report.
[0078] Specifically, the process of steps S2-S4 is repeated to continuously generate new test parameter combinations, execute test cases and evaluate test results. The test process is ended by setting appropriate termination conditions, which can be to reach preset test rounds, discover specific types of errors, such as node crashes, service outages, etc., or meet other test objectives. The test is continuously iterated to gradually approach the performance limit of the distributed storage system, thereby discovering and solving potential problem points in the distributed storage system in advance and enhancing the stability and reliability of the system.
[0079] It should be understood that although Figure 1-2 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1-2 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0080] In one embodiment, Figure 3 As shown, a distributed storage system testing device is provided, including: a construction module, a generation module, a test module and an update module, wherein:
[0081] A construction module, used to create a test scenario library according to the business model of the distributed storage system;
[0082] A generating module, configured to determine a target test scenario from the test scenario library based on current weights of the test scenarios, and to generate target test parameters according to a preset parameter range of the target test scenario;
[0083] A test module, used to generate a test case according to the target test parameters, and execute the test case on the distributed storage system to obtain a test result;
[0084] An updating module is used to update the current parameter value and the current weight value of the target test scenario in the test scenario library according to the target test parameter in response to the test result not satisfying the preset condition, and iteratively test the updated test scenario library until the termination condition is satisfied.
[0085] In one embodiment, the construction module is also used to obtain a business model of the distributed storage system and construct a test scenario based on the business model, wherein the parameters of the business model include one or more of storage file size, number of storage files, number of directories, directory depth, IO size, read-write ratio, random ratio and concurrency number; set the parameter range of each test scenario and create a test scenario library.
[0086] In one embodiment, the generation module is also used to determine a target test scenario from the test scenario library through a random number generator based on current weights of each test scenario; in response to executing a test on the target test scenario for the first time, obtain a parameter range of the target test scenario, and randomly generate a first test parameter within the parameter range as the target test parameter; in response to executing a test on the target test scenario not for the first time, obtain a current parameter value of the target test scenario, and adjust the current parameter value according to a preset adjustment strategy to generate a second test parameter as the target test parameter.
[0087] In one embodiment, the generation module is also used to obtain a second test result in response to not performing a test on the target test scenario for the first time, obtain the current parameter value of the target test scenario, and the test parameters and test results of the last test of the target test scenario; in response to the test result of the last test of the target test scenario not meeting a preset condition, calculate the rate of change based on the second test result and the test result of the last test; determine the target step size based on the change rate, and adjust the current parameter value according to the target step size to generate a second test parameter.
[0088] In one embodiment, the test module is also used to, in response to obtaining a first test result by performing a test on the target test scenario for the first time, compare the first test result with the preset conditions respectively, wherein the first test result is obtained based on the first test parameter; in response to the presence of any type of data in the first test result that does not reach the corresponding index value in the preset condition, determine that the first test result does not meet the preset condition; update the current parameter value of the target test scenario according to the parameter value of the first test parameter, and increase the current weight value of the target test scenario; in response to obtaining a second test result by performing a test on the target test scenario not for the first time, compare the second test result with the test result of the previous test, wherein the second test result is obtained based on the second test parameter; in response to the presence of any type of data in the second test result that does not reach the corresponding data value in the test result of the previous test, determine that the second test result does not meet the preset condition; update the current parameter value of the target test scenario according to the parameter value of the second test parameter, and increase the current weight value of the target test scenario.
[0089] In one embodiment, the update module is also used to determine that the test results meet the preset conditions in response to all data in the test results reaching the corresponding indicator values in the preset conditions or the corresponding data values in the test results of the previous test; retain the current parameter values of the target test scenario, and reduce the current weight value of the target test scenario.
[0090] In one embodiment, the test module is also used to determine a new target test scenario from the test scenario library according to the updated weight, and perform a test on the new target test scenario; in response to reaching a preset number of tests or detecting that a failure of the distributed storage system has occurred, the test is terminated and a test report is output.
[0091] For the specific definition of the distributed storage system testing device, please refer to the definition of the distributed storage system testing method above, which will not be repeated here. Each module in the above-mentioned distributed storage system testing device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0092] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 4 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 of the computer device 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 test scenario data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a distributed storage system testing method is implemented.
[0093] Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0094] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
[0095] Creating a test scenario library according to the business model of the distributed storage system;
[0096] Determining a target test scenario from the test scenario library based on the current weight of each test scenario, and generating a target test parameter according to a preset parameter range of the target test scenario;
[0097] Generate a test case according to the target test parameter, and execute the test case on the distributed storage system to obtain a test result;
[0098] In response to the test result not satisfying a preset condition, the current parameter value and the current weight value of the target test scenario in the test scenario library are updated according to the target test parameter, and the updated test scenario library is iteratively tested until a termination condition is satisfied.
[0099] In one embodiment, when the processor executes the computer program, the following steps are also implemented: obtaining a business model of the distributed storage system, and constructing a test scenario based on the business model, wherein the parameters of the business model include one or more of storage file size, number of storage files, number of directories, directory depth, IO size, read-write ratio, random ratio and concurrency number; setting the parameter range of each test scenario and creating a test scenario library.
[0100] In one embodiment, when the processor executes the computer program, the following steps are also implemented: based on the current weights of each test scenario, a target test scenario is determined from the test scenario library by a random number generator; in response to executing a test on the target test scenario for the first time, a parameter range of the target test scenario is obtained, and a first test parameter is randomly generated within the parameter range as the target test parameter; in response to executing a test on the target test scenario not for the first time, a current parameter value of the target test scenario is obtained, and the current parameter value is adjusted according to a preset adjustment strategy to generate a second test parameter as the target test parameter.
[0101] In one embodiment, when the processor executes the computer program, the following steps are also implemented: in response to obtaining a second test result in a non-first test of the target test scenario, obtaining the current parameter value of the target test scenario, and the test parameters and test results of the last test of the target test scenario; in response to the test result of the last test of the target test scenario not satisfying a preset condition, calculating the rate of change based on the second test result and the test result of the last test; determining a target step size based on the rate of change, and adjusting the current parameter value based on the target step size to generate a second test parameter.
[0102] In one embodiment, the processor further implements the following steps when executing the computer program: in response to obtaining a first test result by performing a test on the target test scenario for the first time, comparing the first test result with the preset condition respectively, wherein the first test result is obtained based on the first test parameter; in response to the presence of any type of data in the first test result that does not reach the corresponding index value in the preset condition, determining that the first test result does not meet the preset condition; updating the current parameter value of the target test scenario according to the parameter value of the first test parameter, and increasing the current weight value of the target test scenario; in response to obtaining a second test result by performing a test on the target test scenario not for the first time, comparing the second test result with the test result of the previous test respectively, wherein the second test result is obtained based on the second test parameter; in response to the presence of any type of data in the second test result that does not reach the corresponding data value in the test result of the previous test, determining that the second test result does not meet the preset condition; updating the current parameter value of the target test scenario according to the parameter value of the second test parameter, and increasing the current weight value of the target test scenario.
[0103] In one embodiment, when the processor executes the computer program, the following steps are also implemented: in response to all the data in the test results reaching the corresponding indicator value in the preset condition or the corresponding data value in the test result of the previous test, determining that the test result meets the preset condition; retaining the current parameter value of the target test scenario, and reducing the current weight value of the target test scenario.
[0104] In one embodiment, when the processor executes the computer program, the following steps are also implemented: determining a new target test scenario from the test scenario library according to the updated weight, and performing a test on the new target test scenario; in response to reaching a preset number of tests, or detecting that a failure of the distributed storage system has occurred, terminating the test and outputting a test report.
[0105] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0106] Creating a test scenario library according to the business model of the distributed storage system;
[0107] Determining a target test scenario from the test scenario library based on the current weight of each test scenario, and generating a target test parameter according to a preset parameter range of the target test scenario;
[0108] Generate a test case according to the target test parameter, and execute the test case on the distributed storage system to obtain a test result;
[0109] In response to the test result not satisfying a preset condition, the current parameter value and the current weight value of the target test scenario in the test scenario library are updated according to the target test parameter, and the updated test scenario library is iteratively tested until a termination condition is satisfied.
[0110] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining a business model of the distributed storage system, and constructing a test scenario based on the business model, wherein the parameters of the business model include one or more of storage file size, number of storage files, number of directories, directory depth, IO size, read-write ratio, random ratio and concurrency number; setting the parameter range of each test scenario and creating a test scenario library.
[0111] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: based on the current weights of each test scenario, determining the target test scenario from the test scenario library by means of a random number generator; in response to executing the test on the target test scenario for the first time, obtaining the parameter range of the target test scenario, and randomly generating a first test parameter within the parameter range as the target test parameter; in response to executing the test on the target test scenario not for the first time, obtaining the current parameter value of the target test scenario, and adjusting the current parameter value according to a preset adjustment strategy to generate a second test parameter as the target test parameter.
[0112] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: in response to obtaining a second test result in a non-first test of the target test scenario, obtaining the current parameter value of the target test scenario, and the test parameters and test results of the last test of the target test scenario; in response to the test result of the last test of the target test scenario not satisfying a preset condition, calculating the rate of change based on the second test result and the test result of the last test; determining a target step size based on the rate of change, and adjusting the current parameter value based on the target step size to generate a second test parameter.
[0113] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: in response to obtaining a first test result by performing a test on the target test scenario for the first time, the first test result is compared with the preset condition respectively, wherein the first test result is obtained based on the first test parameter; in response to the presence of any type of data in the first test result that does not reach the corresponding index value in the preset condition, determining that the first test result does not meet the preset condition; updating the current parameter value of the target test scenario according to the parameter value of the first test parameter, and increasing the current weight value of the target test scenario; in response to obtaining a second test result by performing a test on the target test scenario not for the first time, the second test result is compared with the test result of the previous test, wherein the second test result is obtained based on the second test parameter; in response to the presence of any type of data in the second test result that does not reach the corresponding data value in the test result of the previous test, determining that the second test result does not meet the preset condition; updating the current parameter value of the target test scenario according to the parameter value of the second test parameter, and increasing the current weight value of the target test scenario.
[0114] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: in response to all the data in the test results reaching the corresponding indicator value in the preset condition or the corresponding data value in the test result of the previous test, determining that the test result meets the preset condition; retaining the current parameter value of the target test scenario, and reducing the current weight value of the target test scenario.
[0115] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: determining a new target test scenario from the test scenario library based on the updated weight, and performing a test on the new target test scenario; in response to reaching a preset number of tests, or detecting that a failure of the distributed storage system has occurred, terminating the test and outputting a test report.
[0116] In one embodiment, a computer product is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0117] Creating a test scenario library according to the business model of the distributed storage system;
[0118] Determining a target test scenario from the test scenario library based on the current weight of each test scenario, and generating a target test parameter according to a preset parameter range of the target test scenario;
[0119] Generate a test case according to the target test parameter, and execute the test case on the distributed storage system to obtain a test result;
[0120] In response to the test result not satisfying a preset condition, the current parameter value and the current weight value of the target test scenario in the test scenario library are updated according to the target test parameter, and the updated test scenario library is iteratively tested until a termination condition is satisfied.
[0121] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining a business model of the distributed storage system, and constructing a test scenario based on the business model, wherein the parameters of the business model include one or more of storage file size, number of storage files, number of directories, directory depth, IO size, read-write ratio, random ratio and concurrency number; setting the parameter range of each test scenario and creating a test scenario library.
[0122] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: based on the current weights of each test scenario, determining the target test scenario from the test scenario library by means of a random number generator; in response to executing the test on the target test scenario for the first time, obtaining the parameter range of the target test scenario, and randomly generating a first test parameter within the parameter range as the target test parameter; in response to executing the test on the target test scenario not for the first time, obtaining the current parameter value of the target test scenario, and adjusting the current parameter value according to a preset adjustment strategy to generate a second test parameter as the target test parameter.
[0123] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: in response to obtaining a second test result in a non-first test of the target test scenario, obtaining the current parameter value of the target test scenario, and the test parameters and test results of the last test of the target test scenario; in response to the test result of the last test of the target test scenario not satisfying a preset condition, calculating the rate of change based on the second test result and the test result of the last test; determining a target step size based on the rate of change, and adjusting the current parameter value based on the target step size to generate a second test parameter.
[0124] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: in response to obtaining a first test result by performing a test on the target test scenario for the first time, the first test result is compared with the preset condition respectively, wherein the first test result is obtained based on the first test parameter; in response to the presence of any type of data in the first test result that does not reach the corresponding index value in the preset condition, determining that the first test result does not meet the preset condition; updating the current parameter value of the target test scenario according to the parameter value of the first test parameter, and increasing the current weight value of the target test scenario; in response to obtaining a second test result by performing a test on the target test scenario not for the first time, the second test result is compared with the test result of the previous test, wherein the second test result is obtained based on the second test parameter; in response to the presence of any type of data in the second test result that does not reach the corresponding data value in the test result of the previous test, determining that the second test result does not meet the preset condition; updating the current parameter value of the target test scenario according to the parameter value of the second test parameter, and increasing the current weight value of the target test scenario.
[0125] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: in response to all the data in the test results reaching the corresponding indicator value in the preset condition or the corresponding data value in the test result of the previous test, determining that the test result meets the preset condition; retaining the current parameter value of the target test scenario, and reducing the current weight value of the target test scenario.
[0126] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: determining a new target test scenario from the test scenario library based on the updated weight, and performing a test on the new target test scenario; in response to reaching a preset number of tests, or detecting that a failure of the distributed storage system has occurred, terminating the test and outputting a test report.
[0127] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the 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 used in the embodiments provided in the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an 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 (DDRSDRAM), 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).
[0128] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0129] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A distributed storage system testing method, characterized in that: include: Creating a test scenario library according to the business model of the distributed storage system; Determining a target test scenario from the test scenario library based on the current weight of each test scenario, and generating a target test parameter according to a preset parameter range of the target test scenario; Generate a test case according to the target test parameter, and execute the test case on the distributed storage system to obtain a test result; In response to the test result not satisfying a preset condition, the current parameter value and the current weight value of the target test scenario in the test scenario library are updated according to the target test parameter, and the updated test scenario library is iteratively tested until a termination condition is satisfied.
2. The distributed storage system testing method according to claim 1, characterized in that: The creating a test scenario library according to the business model of the distributed storage system includes: Obtain a business model of the distributed storage system, and build a test scenario according to the business model, wherein the parameters of the business model include one or more of storage file size, number of storage files, number of directories, directory depth, IO size, read-write ratio, random ratio, and concurrency number; Set parameter ranges for each test scenario and create a test scenario library.
3. The distributed storage system testing method according to claim 1, characterized in that: The determining a target test scenario from the test scenario library based on the current weight of each test scenario, and generating a target test parameter according to a parameter range of the target test scenario, comprises: Based on the current weights of the test scenarios, determining a target test scenario from the test scenario library by a random number generator; In response to performing a test on the target test scenario for the first time, obtaining a parameter range of the target test scenario, and randomly generating a first test parameter within the parameter range as the target test parameter; In response to not performing a test on the target test scenario for the first time, a current parameter value of the target test scenario is acquired, and the current parameter value is adjusted according to a preset adjustment strategy to generate a second test parameter as the target test parameter.
4. The distributed storage system testing method according to claim 3, characterized in that: In response to the target test scenario not being tested for the first time, obtaining a current parameter value of the target test scenario, and adjusting the current parameter value according to a preset adjustment strategy to generate a second test parameter as the target test parameter, including: In response to obtaining a second test result by performing a test on the target test scenario not for the first time, obtaining a current parameter value of the target test scenario, and a test parameter and a test result of a previous test of the target test scenario; In response to a test result of a previous test of the target test scenario not satisfying a preset condition, calculating a change rate according to the second test result and the test result of the previous test; A target step length is determined according to the change rate, and the current parameter value is adjusted according to the target step length to generate a second test parameter as the target test parameter.
5. The distributed storage system testing method according to claim 3 or 4, characterized in that: The test result includes one or more of bandwidth, input / output volume per second, and delay; in response to the test result not satisfying a preset condition, updating a current parameter value and a current weight value of the target test scenario in the test scenario library according to the target test parameter, including: In response to obtaining a first test result by performing a test on the target test scenario for the first time, comparing the first test result with the preset conditions respectively, wherein the first test result is obtained based on the first test parameter; In response to any type of data in the first test result not reaching the index value corresponding to the preset condition, determining that the first test result does not meet the preset condition; updating the current parameter value of the target test scenario according to the parameter value of the first test parameter, and increasing the current weight value of the target test scenario; In response to obtaining a second test result by performing a test on the target test scenario not for the first time, comparing the second test result with the test result of a previous test, wherein the second test result is obtained based on the second test parameter; In response to the presence of any type of data in the second test result not reaching a corresponding data value in the test result of the previous test, determining that the second test result does not meet a preset condition; The current parameter value of the target test scenario is updated according to the parameter value of the second test parameter, and the current weight value of the target test scenario is increased.
6. The distributed storage system testing method according to claim 5, characterized in that: The method further comprises: In response to all data in the test result reaching the index value corresponding to the preset condition or the data value corresponding to the test result of the last test, determining that the test result meets the preset condition; The current parameter values of the target test scenario are retained, and the current weight value of the target test scenario is reduced.
7. The distributed storage system testing method according to claim 1, characterized in that: The iterative testing of the updated test scenario library until the termination condition is met includes: Determining a new target test scenario from the test scenario library according to the updated weight, and performing a test on the new target test scenario; In response to reaching a preset number of tests, or detecting that a failure occurs in the distributed storage system, the test is terminated and a test report is output.
8. A distributed storage system testing device, characterized in that: The device comprises: A construction module, used to create a test scenario library according to the business model of the distributed storage system; A generating module, configured to determine a target test scenario from the test scenario library based on current weights of the test scenarios, and to generate target test parameters according to a preset parameter range of the target test scenario; A test module, used to generate a test case according to the target test parameters, and execute the test case on the distributed storage system to obtain a test result; An updating module is used to update the current parameter value and the current weight value of the target test scenario in the test scenario library according to the target test parameter in response to the test result not satisfying the preset condition, and iteratively test the updated test scenario library until the termination condition is satisfied.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, 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, 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.
Citation Information
Cited By
Hard disk test method and electronic equipment
CN120673793A
Memory bank SLT automatic test method and device, equipment and medium
CN120950318A