A storage pressure test method, device, equipment and medium
Patent Information
- Application Number
- CN202210893161.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-27
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2042-07-27
AI Technical Summary
当前的存储压力测试中,一方面,需要手动进行压力测试,其过程非常繁琐、复杂,当数据处理量多时还容易出错,且压力测试时间较长,一般为24小时或48小时,导致测试效率低,人力投入较大,测试成本较高;另一方面,在测试开始后也需要人工随时去查看界面,来监测测试的状态,当出错时难以及时发现错误并停止,浪费了测试资源
[0037]可见,本申请获取测试场景信息,并基于所述测试场景信息分别从预先构建的测试策略池和配置文件模板库中选择相应的目标测试策略和目标配置模板文件;启动预设测试工具全选盘符并基于所述目标配置模板文件导出对应的目标配置文件;对所述目标配置文件进行解析以获取所有硬盘盘符,并从所有所述硬盘盘符中剔除系统盘盘符得到待测硬盘盘符;基于所述目标测试策略和所述待测硬盘盘符对所述目标配置模板文件中的数据进行调整得到调整后配置文件,并将所述调整后配置文件导入所述预设测试工具以启动存储压力测试。由此可见,本申请通过预先构建测试策略池和配置文件模板库,并在获取到测试场景信息后则从测试策略池和配置文件模板库中选择相应的目标测试策略和目标配置模板文件,然后对导出的目标配置文件进行处理以获取待测硬盘盘符,再利用目标测试策略和待测硬盘盘符对目标配置模板文件中的数据进行调整,最后将调整后的配置文件导入预设测试工具以启动存储压力测试。通过上述技术方案,能够实现自动化的存储压力测试,无需人工参与,减少了人工成本并提高了测试效率。
Smart Images

Figure CN115185757B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a storage stress testing method, apparatus, device, and medium. Background Technology
[0002] Storage stress testing under Windows can be performed using Iometer, a free and open-source disk performance testing tool. Compared to other disk tools, Iometer can test I / O transfer rate and average I / O response time. Traditional testing involves manually creating test workers, selecting hard drives, and setting numerous test parameters. Since test scenarios involve various types of hard drives, backplanes, and RAID cards, and the number of workers required for some tests varies depending on the number of processor threads (often reaching up to 128), current storage stress testing suffers from several drawbacks. Firstly, manual stress testing is cumbersome and complex, prone to errors when dealing with large amounts of data, and time-consuming (typically 24 or 48 hours), resulting in low efficiency, high manpower investment, and high costs. Secondly, after the test begins, manual monitoring of the interface is required to track the test status, making it difficult to detect and stop errors promptly, thus wasting test resources.
[0003] In summary, how to automate storage stress testing to reduce labor costs and improve testing efficiency is a problem that needs to be solved. Summary of the Invention
[0004] In view of this, the purpose of this invention is to provide a storage stress testing method, apparatus, device, and medium that can automate storage stress testing to reduce labor costs and improve testing efficiency. The specific solution is as follows:
[0005] Firstly, this application discloses a storage stress testing method, including:
[0006] Obtain test scenario information, and select the corresponding target test strategy and target configuration template file from the pre-built test strategy pool and configuration file template library respectively based on the test scenario information;
[0007] Launch the preset test tool, select all drive letters, and export the corresponding target configuration file based on the target configuration template file;
[0008] The target configuration file is parsed to obtain all hard drive drive letters, and the system drive letter is removed from all the hard drive drive letters to obtain the hard drive drive letter to be tested.
[0009] Based on the target test strategy and the drive letter of the hard disk to be tested, the data in the target configuration template file is adjusted to obtain the adjusted configuration file, and the adjusted configuration file is imported into the preset test tool to start the storage stress test.
[0010] Optionally, the storage stress test method further includes:
[0011] Different test strategies are pre-acquired to construct the test strategy pool; wherein, the test strategy includes the number of worker processes to be created, the correspondence between worker processes and the hard disks to be tested, the test duration, the monitoring strategy, and the test parameter adjustment strategy.
[0012] Optionally, the storage stress test method further includes:
[0013] Pre-obtain test parameters for different types of test scenarios, and build corresponding test template files based on the test parameters for the same type of test scenario;
[0014] The configuration file template library is constructed based on the test template files corresponding to each type of test scenario.
[0015] Optionally, the step of removing the system drive letter from all the drive letters to obtain the drive letter of the hard drive to be tested includes:
[0016] The corresponding system disk drive letter is selected from all the hard disk drive letters based on the first preset keyword;
[0017] The system disk drive letter is removed from all the hard drive drive letters to obtain the hard drive drive letter to be tested.
[0018] Optionally, the step of adjusting the data in the target configuration template file based on the target testing strategy and the drive letter of the hard disk to be tested to obtain the adjusted configuration file includes:
[0019] Delete the hard drive letter in the target configuration template file, save the remaining data information of the target configuration template file to a preset list, and determine the current number of worker processes in the remaining data information. Then, determine whether the number of worker processes to be created in the target test strategy is consistent with the current number of worker processes.
[0020] If they match, the preset list is traversed, and when the second preset keyword is encountered, the drive letter of the hard drive to be tested is input to each worker process in the preset list based on the correspondence between worker processes and hard drives to be tested in the target test strategy.
[0021] The adjusted configuration file is obtained by adjusting the target configuration template file based on the preset list.
[0022] Optionally, after determining whether the number of worker processes to be created in the target testing strategy is consistent with the current number of worker processes, the method further includes:
[0023] If the number of worker processes to be created is less than the number of current worker processes, then delete the corresponding number of current worker processes so that the number of worker processes to be created is consistent with the number of current worker processes;
[0024] If the number of worker processes to be created is greater than the number of current worker processes, then a copy operation is performed on the current number of worker processes so that the number of current worker processes after copying is consistent with the number of worker processes to be created.
[0025] Optionally, the storage stress test method further includes:
[0026] Log information during the test is retrieved at preset time intervals, and the current test status is determined based on the log information.
[0027] If any abnormal situation occurs, the test will be stopped and an alarm message will be displayed.
[0028] Secondly, this application discloses a storage stress testing device, comprising:
[0029] The information reading module is used to acquire test scenario information and, based on the test scenario information, read the corresponding target test strategy and target configuration template file from the pre-built test strategy pool and configuration file template library, respectively.
[0030] The file export module is used to launch a preset test tool, select all drive letters, and export the corresponding target configuration file based on the target configuration template file.
[0031] The module for determining the hard drive under test is used to parse the target configuration file to obtain all hard drive drive letters, and remove the system drive letter from all the hard drive drive letters to obtain the hard drive drive letter under test;
[0032] The stress testing module is used to adjust the data in the target configuration template file based on the target testing strategy and the drive letter of the hard disk to be tested to obtain an adjusted configuration file, and import the adjusted configuration file into the preset testing tool to start the storage stress test.
[0033] Thirdly, this application discloses an electronic device, including:
[0034] Memory, used to store computer programs;
[0035] A processor for executing the computer program to implement the steps of the aforementioned disclosed storage stress testing method.
[0036] Fourthly, this application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the steps of the aforementioned disclosed storage stress testing method.
[0037] As can be seen, this application acquires test scenario information and selects corresponding target test strategies and target configuration template files from a pre-built test strategy pool and configuration file template library based on the test scenario information; it launches a preset test tool, selects all drive letters, and exports the corresponding target configuration file based on the target configuration template file; it parses the target configuration file to obtain all hard drive letters, and removes the system drive letter from all the hard drive letters to obtain the hard drive letter to be tested; it adjusts the data in the target configuration template file based on the target test strategy and the hard drive letter to be tested to obtain an adjusted configuration file, and imports the adjusted configuration file into the preset test tool to start the storage stress test. Thus, this application pre-builds a test strategy pool and configuration file template library, selects corresponding target test strategies and target configuration template files from the test strategy pool and configuration file template library after acquiring test scenario information, processes the exported target configuration file to obtain the hard drive letter to be tested, adjusts the data in the target configuration template file using the target test strategy and the hard drive letter to be tested, and finally imports the adjusted configuration file into a preset test tool to start the storage stress test. The above technical solution enables automated storage stress testing without human intervention, reducing labor costs and improving testing efficiency. Attached Figure Description
[0038] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0039] Figure 1 This is a flowchart of a storage stress testing method disclosed in this application;
[0040] Figure 2 This is a flowchart of a specific storage stress testing method disclosed in this application;
[0041] Figure 3 This application discloses a specific storage stress test flowchart;
[0042] Figure 4This is a schematic diagram of the structure of a storage pressure testing device disclosed in this application;
[0043] Figure 5 This is a structural diagram of an electronic device disclosed in this application. Detailed Implementation
[0044] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0045] Current storage stress testing suffers from several drawbacks. Firstly, it requires manual testing, a cumbersome and complex process prone to errors, especially with large data volumes. Furthermore, the testing duration is lengthy, typically 24 or 48 hours, resulting in low efficiency, high manpower investment, and high costs. Secondly, manual monitoring of the interface is necessary after the test begins, making it difficult to promptly detect and stop errors, thus wasting testing resources. Therefore, this application discloses a storage stress testing method, apparatus, device, and medium that automates storage stress testing to reduce labor costs and improve testing efficiency.
[0046] See Figure 1 As shown in the figure, this application discloses a storage stress testing method, which includes:
[0047] Step S11: Obtain test scenario information, and select the corresponding target test strategy and target configuration template file from the pre-built test strategy pool and configuration file template library based on the test scenario information.
[0048] In this embodiment, when starting the test, the incoming test scenario information is obtained. Then, the background program automatically matches and reads the corresponding target test strategy from the pre-built test strategy pool based on the test scenario information, and automatically matches the corresponding target configuration template file from the pre-built configuration file template library based on the test scenario information, and names the target configuration template file sample.icf. The aforementioned test scenario information may include, but is not limited to, RAID, BP, HDD, tencent_nvme, SSD, etc.
[0049] It should be noted that the above-mentioned storage stress testing method may further include: pre-acquiring different test strategies to construct the test strategy pool; wherein, the test strategy includes the number of worker processes to be created, the correspondence between worker processes and the hard drives under test, the test duration, the monitoring strategy, and the test parameter adjustment strategy. That is, for different test scenarios, different test strategies are grouped into a strategy pool, including the number of worker processes to be created, the correspondence between worker processes and the hard drives under test (i.e., each worker corresponds to all hard drives under test or one worker corresponds to one hard drive under test), the test duration, the monitoring strategy, and how the test parameters need to be adjusted, etc.
[0050] Furthermore, the aforementioned storage stress testing method may further include: pre-acquiring test parameters for different types of test scenarios, and constructing corresponding test template files based on the test parameters for the same type of test scenario; and constructing the configuration file template library based on the test template files corresponding to each type of test scenario. It is understandable that test parameters may differ significantly between different test scenarios, but the similarity within the same test scenario is very high. For example, testing hard drives on a backplane and testing hard drives under a RAID card may have significantly different read / write mode settings, but testing hard drives on a backplane will have very similar read / write mode settings. Another example is that Tencent NVMe hard drive testing starts at 4KB, while SSD hard drive testing starts at 512B. Therefore, extracting some parameter settings with minor differences into test template files—specifically, constructing corresponding test template files based on the test parameters for the same type of test scenario, and then constructing a configuration file template library based on the test template files corresponding to each type of test scenario—and then fine-tuning the template files according to the specific test strategy during use, can simplify the test preparation steps and improve test efficiency.
[0051] Step S12: Launch the preset test tool, select all drive letters, and export the corresponding target configuration file based on the target configuration template file.
[0052] In this embodiment, a preset test tool is launched, selecting all drive letters. Specifically, this preset test tool can be iometer. The specific operation process is as follows:
[0053] First, launch the software iometer.exe.
[0054] app = Application(backend="uia")
[0055] app.start(iometer_tool_path)
[0056] Then, combining automatic button click technology and intelligent positioning technology of software controls, specifically, by continuously clicking: root node -> Disk Targets -> root node of the drive list, the location is determined in the drive list. The click operation uses a combination of node coordinates obtained by the app and click coordinates obtained by Pytuogui to ensure stable and accurate operation.
[0057] Finally, select all drive letters:
[0058] Pytuogui, keyDown('ctrl')
[0059] Pytuogui, keyDown('a')
[0060] Pytuogui, keyUp('ctrl')
[0061] Pytuogui, keyUp('a')
[0062] Next, based on the target configuration template file, export the corresponding target configuration file and name it back.icf. The specific operation process is as follows:
[0063] Click the "Save Test Configuration File" button, enter the save path and file name back.icf, and click save.
[0064] app.click("Iometer", "Save Test Configuration FileButtun")
[0065] To ensure compatibility with both Chinese and English operating systems, the following two methods need to be combined.
[0066] app.input("Iometer", "filename", file_path)
[0067] app.click("Iometer", "Save(S)")
[0068] or
[0069] app.input("Iometer", "File name:Edit", file_path)
[0070] app.click ("Iometer", "Save")
[0071] Step S13: Parse the target configuration file to obtain all hard disk drive letters, and remove the system drive letter from all the hard disk drive letters to obtain the hard disk drive letter to be tested.
[0072] In this embodiment, file parsing technology is used to parse the target configuration file to obtain all hard drive letters. Then, the system drive letter is removed from all the hard drive letters to obtain the hard drive letters to be tested. That is, the back.icf file is parsed to exclude the system drive and obtain all other hard drives to be tested. It can be understood that the storage stress test process will continuously perform data read and write operations on the hard drive, so the system drive must be excluded, otherwise it may lead to the deletion or crash of the operating system. This step involves opening the file, traversing the file content to obtain all hard drive letters on the machine, and then removing the system drive from the obtained drive letters. The remaining ones are the hard drive letters that can be tested.
[0073] Step S14: Based on the target test strategy and the drive letter of the hard disk to be tested, adjust the data in the target configuration template file to obtain the adjusted configuration file, and import the adjusted configuration file into the preset test tool to start the storage stress test.
[0074] In this embodiment, after obtaining the drive letter of the hard drive to be tested, the drive letter is combined with the worker processes in the target configuration template file sample.icf according to the target testing strategy. By opening files and traversing data information, the drive letter information of the hard drive to be tested is input into each worker process. Depending on the strategy, either one worker process corresponds to one drive letter to be tested, or one worker process corresponds to multiple drive letters to be tested. The specific test parameters of the worker processes are then adjusted as needed. The worker is the test item. The target testing strategy specifies the number of worker processes to be created; that is, how many worker processes need to be created. Corresponding worker processes in the target configuration template file need to be added or deleted to meet the requirements.
[0075] Furthermore, after adjusting the data in the target configuration template file based on the target testing strategy and the drive letter of the hard drive to be tested, and obtaining the adjusted configuration file, the adjusted configuration file is imported into the preset testing tool to start the storage stress test. That is, the adjusted sample.icf is imported into iometer to start the iometer stress test. The specific operation can be as follows:
[0076] Import the prepared configuration file into iometer by clicking the "Open Test Configuration File" button:
[0077] app.click("Iometer","Open Test Configuration FileButtun")
[0078] Similarly, to ensure compatibility with both Chinese and English operating systems, the following two methods need to be combined.
[0079] app.input(“Iometer”, “Open(0)”, file_path)
[0080] app.input ("Iometer", "File name:Edit", file_path)
[0081] Finally, click the "Start Tests" button to begin the test.
[0082] It should be noted that this solution integrates Windows GUI operation technologies such as pyautogui and pywinauto, and once the test begins, the entire process is automated and requires no human intervention.
[0083] As can be seen, this application acquires test scenario information and selects corresponding target test strategies and target configuration template files from a pre-built test strategy pool and configuration file template library based on the test scenario information; it launches a preset test tool, selects all drive letters, and exports the corresponding target configuration file based on the target configuration template file; it parses the target configuration file to obtain all hard drive letters, and removes the system drive letter from all the hard drive letters to obtain the hard drive letter to be tested; it adjusts the data in the target configuration template file based on the target test strategy and the hard drive letter to be tested to obtain an adjusted configuration file, and imports the adjusted configuration file into the preset test tool to start the storage stress test. Thus, this application pre-builds a test strategy pool and configuration file template library, selects corresponding target test strategies and target configuration template files from the test strategy pool and configuration file template library after acquiring test scenario information, processes the exported target configuration file to obtain the hard drive letter to be tested, adjusts the data in the target configuration template file using the target test strategy and the hard drive letter to be tested, and finally imports the adjusted configuration file into a preset test tool to start the storage stress test. The above technical solution enables automated storage stress testing without human intervention, reducing labor costs and improving testing efficiency.
[0084] See Figure 2 and Figure 3 As shown, this application discloses a specific storage stress testing method. Compared to the previous embodiment, this embodiment further explains and optimizes the technical solution. Specifically, it includes:
[0085] Step S21: Obtain test scenario information, and select the corresponding target test strategy and target configuration template file from the pre-built test strategy pool and configuration file template library based on the test scenario information.
[0086] Step S22: Launch the preset test tool, select all drive letters, and export the corresponding target configuration file based on the target configuration template file.
[0087] Step S23: Parse the target configuration file to obtain all hard disk drive letters, and filter out the corresponding system drive letter from all the hard disk drive letters according to the first preset keyword. Then, remove the system drive letter from all the hard disk drive letters to obtain the hard disk drive letter to be tested.
[0088] In this embodiment, the system disk drive letter is specifically selected from all hard disk drive letters based on the first preset keyword. The first preset keyword can be "volume{", that is, if there is a hard disk drive letter marked with the keyword "volume{", it represents the system disk partition and is removed. The remaining hard disk drive letters are the hard disk drive letters that can be tested.
[0089] The specific steps described above can be as follows:
[0090] Traverse the entire file content, analyze its characteristics, and extract all data blocks. The number of such data blocks corresponds to the number of drive letters on the machine.
[0091] Target
[0092] disk
[0093] Target Type
[0094] DISK
[0095] End Target
[0096] Then, the system disk drive letter is obtained using os.getenv(“SystemDrive”). The corresponding data block is extracted from the above data. If any drive letter contains the keyword “volume{”, it is removed. The remaining drive letter information represents the hard drives that can be tested and is stored in the target_list list.
[0097] Step S24: Delete the hard disk drive letter in the target configuration template file, save the remaining data information of the target configuration template file to a preset list, determine the current number of worker processes in the remaining data information, and then determine whether the number of worker processes to be created in the target test strategy is consistent with the current number of worker processes.
[0098] In this embodiment, the hard drive letter in the target configuration template file is first deleted because the hard drive information in the template file is not the actual test hard drive information, so it needs to be removed. Specifically, the contents of the target configuration template file are traversed, and the Target data block in the template data is removed. Then, the remaining data information of the target configuration template file is saved to a preset list, and the number of Worker to End Worker data blocks in the remaining information is determined, i.e., the current number of worker processes in the template. The aforementioned preset list can specifically be the valid_info list. Next, it is determined whether the number of worker processes to be created in the target test strategy is consistent with the current number of worker processes.
[0099] Step S25: If they match, traverse the preset list, and when the second preset keyword is encountered, input the drive letter of the hard drive to be tested into each worker process in the preset list based on the correspondence between worker processes and hard drives to be tested in the target test strategy.
[0100] In this embodiment, if the number of worker processes to be created in the target testing strategy is the same as the current number of worker processes, the valid_info list is traversed. When the second preset keyword is encountered, the drive letter of the hard drive to be tested is input to each worker process in the preset list based on the correspondence between worker processes and hard drives to be tested in the target testing strategy. It is understood that this embodiment requires adjusting the data in the target configuration template file according to the requirements of the target testing strategy. For example, suppose the test requires creating corresponding worker processes based on the number of processor threads, and one worker process needs to test all drive letters to be tested. First, the number of worker processes to be created in the target testing strategy must be the same as the current number of worker processes. Then, the valid_info information is traversed. Each time the Target assignments keyword is encountered, the process stops, and all information in the target_list is added to the valid_info list, until all worker processes have been traversed, thus assembling the required test data.
[0101] In another specific embodiment, after determining whether the number of worker processes to be created in the target testing strategy is consistent with the number of current worker processes, the method further includes: if the number of worker processes to be created is less than the number of current worker processes, then a corresponding number of current worker processes are deleted so that the number of worker processes to be created is consistent with the number of current worker processes; if the number of worker processes to be created is greater than the number of current worker processes, then the number of current worker processes is copied so that the copied number of current worker processes is consistent with the number of worker processes to be created. That is, when the number of worker processes to be created in the target testing strategy is inconsistent with the number of current worker processes, the number of worker processes to be created is used as a benchmark to perform deletion or copying / addition operations on the current worker processes, so that the processed number of current worker processes is consistent with the number of worker processes to be created.
[0102] Step S26: Adjust the target configuration template file based on the preset list to obtain the adjusted configuration file, and import the adjusted configuration file into the preset test tool to start the storage stress test.
[0103] In this embodiment, the target configuration template file is adjusted based on a preset list to obtain an adjusted configuration file. The adjusted configuration file is then imported into iometer to start the storage stress test. This involves overwriting and updating the valid_info information in the sample.icf file, and then importing sample.icf into iometer to start the iometer stress test.
[0104] Furthermore, the aforementioned storage stress testing method also includes: acquiring log information during the test process at preset time intervals, and determining whether the current test status is normal based on the log information; if an abnormality occurs, the test is terminated and an alarm message is displayed. That is, by setting a preset time interval, the interface is monitored periodically, test process log information is output, and the current test status is determined based on the log information. When an abnormality that does not conform to the test strategy occurs, the test is terminated immediately ("Abort All Tests"), and a clear alarm message is given. In addition, a timed screenshot function can be added during the test process to continuously improve the test strategy pool.
[0105] For more detailed processing procedures of steps S21 and S22, please refer to the relevant content disclosed in the foregoing embodiments, which will not be repeated here.
[0106] As can be seen, the embodiments of this application provide an automated method for stress testing of storage devices under Windows, which can replace the entire process of traditional manual stress testing, continuously monitor the test status, issue timely alarms, and terminate the test in a timely manner. Furthermore, it has a complete test strategy pool and configuration file template library, fully adapting to all current server storage device testing scenarios and possessing continuous improvement capabilities.
[0107] See Figure 4 As shown in the figure, this application discloses a storage stress testing device, which includes:
[0108] The information reading module 11 is used to acquire test scenario information and read the corresponding target test strategy and target configuration template file from the pre-built test strategy pool and configuration file template library based on the test scenario information.
[0109] The file export module 12 is used to launch a preset test tool, select all drive letters, and export the corresponding target configuration file based on the target configuration template file.
[0110] The test hard disk determination module 13 is used to parse the target configuration file to obtain all hard disk drive letters, and remove the system disk drive letter from all the hard disk drive letters to obtain the test hard disk drive letter.
[0111] The stress testing module 14 is used to adjust the data in the target configuration template file based on the target testing strategy and the drive letter of the hard disk to be tested to obtain an adjusted configuration file, and import the adjusted configuration file into the preset testing tool to start the storage stress test.
[0112] As can be seen, this application acquires test scenario information and selects corresponding target test strategies and target configuration template files from a pre-built test strategy pool and configuration file template library based on the test scenario information; it launches a preset test tool, selects all drive letters, and exports the corresponding target configuration file based on the target configuration template file; it parses the target configuration file to obtain all hard drive letters, and removes the system drive letter from all the hard drive letters to obtain the hard drive letter to be tested; it adjusts the data in the target configuration template file based on the target test strategy and the hard drive letter to be tested to obtain an adjusted configuration file, and imports the adjusted configuration file into the preset test tool to start the storage stress test. Thus, this application pre-builds a test strategy pool and configuration file template library, selects corresponding target test strategies and target configuration template files from the test strategy pool and configuration file template library after acquiring test scenario information, processes the exported target configuration file to obtain the hard drive letter to be tested, adjusts the data in the target configuration template file using the target test strategy and the hard drive letter to be tested, and finally imports the adjusted configuration file into a preset test tool to start the storage stress test. The above technical solution enables automated storage stress testing without human intervention, reducing labor costs and improving testing efficiency.
[0113] In some specific embodiments, the storage stress testing device may further include:
[0114] The strategy pool construction unit is used to pre-acquire different test strategies to construct the test strategy pool; wherein, the test strategy includes the number of worker processes to be created, the correspondence between worker processes and the hard disks to be tested, the test duration, the monitoring strategy, and the test parameter adjustment strategy.
[0115] In some specific embodiments, the storage stress testing device may further include:
[0116] The template file building unit is used to pre-obtain test parameters for different types of test scenarios and build corresponding test template files based on the test parameters of the same type of test scenario;
[0117] The template library construction unit is used to construct the configuration file template library based on the test template files corresponding to various test scenarios.
[0118] In some specific embodiments, the hard disk to be tested determination module 13 may specifically include:
[0119] The system disk drive letter determination unit is used to filter out the corresponding system disk drive letter from all the hard disk drive letters according to the first preset keyword;
[0120] The elimination unit is used to eliminate the system disk drive letter from all the hard disk drive letters to obtain the hard disk drive letter to be tested.
[0121] In some specific embodiments, the stress testing module 14 may specifically include:
[0122] The process count determination unit is used to delete the hard disk drive letter in the target configuration template file, save the remaining data information of the target configuration template file to a preset list, determine the current worker process count in the remaining data information, and then determine whether the number of worker processes to be created in the target test strategy is consistent with the current worker process count.
[0123] The input unit is used to traverse the preset list if the two are consistent, and when the second preset keyword is encountered, input the drive letter of the hard drive to be tested into each worker process in the preset list based on the correspondence between worker processes and hard drives to be tested in the target test strategy.
[0124] The template file adjustment unit is used to adjust the target configuration template file based on the preset list to obtain the adjusted configuration file.
[0125] In some specific embodiments, after the process count determination unit, there may also be:
[0126] The process deletion unit is used to delete a corresponding number of current worker processes if the number of worker processes to be created is less than the number of current worker processes, so that the number of worker processes to be created is consistent with the number of current worker processes.
[0127] The process number replication unit is used to replicate the current worker process number if the number of worker processes to be created is greater than the current worker process number, so that the replicated current worker process number is consistent with the number of worker processes to be created.
[0128] In some specific embodiments, the storage stress testing device may further include:
[0129] The status detection unit is used to acquire log information during the test process at preset time intervals and determine whether the current test status is normal based on the log information.
[0130] The alarm notification unit is used to stop the test and display an alarm message if an abnormal situation occurs.
[0131] Figure 5This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Specifically, it may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the storage stress test method performed by the electronic device disclosed in any of the foregoing embodiments.
[0132] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0133] The processor 21 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 21 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 21 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 21 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.
[0134] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon include operating system 221, computer program 222 and data 223, etc., and the storage method can be temporary storage or permanent storage.
[0135] The operating system 221 manages and controls the various hardware devices and computer programs 222 on the electronic device 20 to enable the processor 21 to perform calculations and processing on the massive amounts of data 223 in the memory 22. The operating system 221 can be Windows, Unix, Linux, etc. The computer program 222, in addition to including a computer program capable of performing the storage stress test method executed by the electronic device 20 as disclosed in any of the foregoing embodiments, may further include computer programs capable of performing other specific tasks. The data 223 may include data received by the electronic device from external devices, as well as data collected by its own input / output interface 25.
[0136] Furthermore, embodiments of this application also disclose a computer-readable storage medium storing a computer program. When the computer program is loaded and executed by a processor, it implements the method steps performed during the storage stress test disclosed in any of the foregoing embodiments.
[0137] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.
[0138] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0139] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0140] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0141] The above provides a detailed description of the storage pressure testing method, apparatus, device, and storage medium provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A storage stress testing method, characterized in that, include: Obtain test scenario information, and select the corresponding target test strategy and target configuration template file from the pre-built test strategy pool and configuration file template library respectively based on the test scenario information; Launch the preset test tool, select all drive letters, and export the corresponding target configuration file based on the target configuration template file; The target configuration file is parsed to obtain all hard drive drive letters, and the system drive letter is removed from all the hard drive drive letters to obtain the hard drive drive letter to be tested. Based on the target test strategy and the drive letter of the hard disk to be tested, the data in the target configuration template file is adjusted to obtain the adjusted configuration file, and the adjusted configuration file is imported into the preset test tool to start the storage stress test; The storage stress testing method further includes: Different test strategies are pre-acquired to construct the test strategy pool; wherein, the test strategy includes the number of worker processes to be created, the correspondence between worker processes and hard disks to be tested, the test duration, the monitoring strategy, and the test parameter adjustment strategy; the correspondence includes one worker corresponding to all hard disks to be tested or one worker corresponding to one hard disk to be tested; The process of adjusting the data in the target configuration template file based on the target testing strategy and the drive letter of the hard disk to be tested to obtain the adjusted configuration file includes: Delete the hard drive letter in the target configuration template file, save the remaining data information of the target configuration template file to a preset list, and determine the current number of worker processes in the remaining data information. Then, determine whether the number of worker processes to be created in the target test strategy is consistent with the current number of worker processes. If they match, the preset list is traversed, and when the second preset keyword is encountered, the drive letter of the hard drive to be tested is input to each worker process in the preset list based on the correspondence between worker processes and hard drives to be tested in the target test strategy. Then, the target configuration template file is adjusted based on the preset list to obtain the adjusted configuration file. If the number of worker processes to be created is less than the number of current worker processes, then delete the corresponding number of current worker processes so that the number of worker processes to be created is consistent with the number of current worker processes. If the number of worker processes to be created is greater than the number of current worker processes, then the number of current worker processes is copied so that the number of current worker processes after copying is the same as the number of worker processes to be created.
2. The storage stress testing method according to claim 1, characterized in that, Also includes: Pre-obtain test parameters for different types of test scenarios, and build corresponding test template files based on the test parameters for the same type of test scenario; The configuration file template library is constructed based on the test template files corresponding to each type of test scenario.
3. The storage stress testing method according to claim 1, characterized in that, The step of removing the system drive letter from all the drive letters to obtain the drive letter of the hard drive to be tested includes: The corresponding system disk drive letter is selected from all the hard disk drive letters based on the first preset keyword; The system disk drive letter is removed from all the hard drive drive letters to obtain the hard drive drive letter to be tested.
4. The storage stress testing method according to any one of claims 1 to 3, characterized in that, Also includes: Log information during the test is retrieved at preset time intervals, and the current test status is determined based on the log information. If any abnormal situation occurs, the test will be stopped and an alarm message will be displayed.
5. A storage pressure testing device, characterized in that, include: The information reading module is used to acquire test scenario information and, based on the test scenario information, read the corresponding target test strategy and target configuration template file from the pre-built test strategy pool and configuration file template library, respectively. The file export module is used to launch a preset test tool, select all drive letters, and export the corresponding target configuration file based on the target configuration template file. The module for determining the hard drive under test is used to parse the target configuration file to obtain all hard drive drive letters, and remove the system drive letter from all the hard drive drive letters to obtain the hard drive drive letter under test; The stress testing module is used to adjust the data in the target configuration template file based on the target testing strategy and the drive letter of the hard disk to be tested to obtain an adjusted configuration file, and import the adjusted configuration file into the preset testing tool to start the storage stress test; The storage pressure testing device further includes: A strategy pool construction unit is used to pre-acquire different test strategies to construct the test strategy pool; wherein, the test strategy includes the number of worker processes to be created, the correspondence between worker processes and hard disks to be tested, the test duration, the monitoring strategy, and the test parameter adjustment strategy; the correspondence includes one worker corresponding to all hard disks to be tested or one worker corresponding to one hard disk to be tested; The stress testing module specifically includes: The process count determination unit is used to delete the hard disk drive letter in the target configuration template file, save the remaining data information of the target configuration template file to a preset list, determine the current worker process count in the remaining data information, and then determine whether the number of worker processes to be created in the target test strategy is consistent with the current worker process count. The input unit is used to traverse the preset list if the two are consistent, and when the second preset keyword is encountered, input the drive letter of the hard drive to be tested into each worker process in the preset list based on the correspondence between worker processes and hard drives to be tested in the target test strategy. The template file adjustment unit is used to adjust the target configuration template file based on the preset list to obtain the adjusted configuration file. The process deletion unit is used to delete a corresponding number of current worker processes if the number of worker processes to be created is less than the number of current worker processes, so that the number of worker processes to be created is consistent with the number of current worker processes. The process number replication unit is used to replicate the current worker process number if the number of worker processes to be created is greater than the current worker process number, so that the replicated current worker process number is consistent with the number of worker processes to be created.
6. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the storage stress testing method as described in any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that, Used for storing computer programs; wherein, when the computer programs are executed by a processor, they implement the steps of the storage stress testing method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Hard disk pressure testing method allowing real-time display of performance data
CN108920319A
Hard disk testing method, apparatus, device, and computer-readable storage medium
CN109376046A