Test method, device and equipment for storage equipment

By performing multiple functional tests and data verification on the storage domain extender, the problem of incomplete testing of the storage domain extender is solved, the testing efficiency and accuracy are improved, and the reliability and stability of the storage device are ensured.

CN120276922APending Publication Date: 2025-07-08INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510495123.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-18
Publication Date
2025-07-08

AI Technical Summary

Technical Problem

In the prior art, the test scenarios of storage domain extenders are single, with low testing efficiency, and it is impossible to fully verify their functions and stability.

Method used

By writing data on multiple hard disks and generating verification information, the storage domain extender is subjected to a variety of functional tests, including interface enable status, interface connection status, interface rate and firmware upgrade tests, and after the test is passed, the hard disk data is verified to ensure data consistency.

Benefits of technology

It realizes comprehensive functional verification of the storage domain extender, improves test accuracy and efficiency, reduces manual operation risks, and ensures the reliability and stability of the storage device under high pressure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120276922A_ABST
    Figure CN120276922A_ABST
Patent Text Reader

Abstract

The invention provides a test method, device and equipment for storage equipment, and can be applied to the technical field of servers. The method comprises the following steps: respectively writing data into a plurality of hard disks, and generating first verification information for the data in each hard disk; performing multiple function tests on the storage domain expander in sequence; under the condition that the storage domain expander passes multiple function tests, data are read from the multiple hard disks respectively, and second verification information is generated for the data read from each hard disk; and under the condition that the first verification information and the second verification information of the data in each hard disk are consistent, determining that the test is passed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of servers, and in particular, to a test method, device, and equipment for a storage device. Background Art

[0002] A storage domain expander is a core component in a storage device used to manage and expand storage interfaces. In order to cope with the complexity brought about by the upgrade of storage protocols, the gradual increase in interface speed, the exponential combinatorial explosion of compatibility tests, etc., it is necessary to test the storage domain expander in the storage device to ensure the stability of the storage domain expander. However, in related technologies, there are problems of single test scenarios and low test efficiency in the test of the storage domain expander. Summary of the Invention

[0003] In view of the above problems, this application provides a test method, device, and equipment for a storage device.

[0004] According to the first aspect of this application, a test method for a storage device is provided. The storage device includes a plurality of hard disks and a storage domain expander connected to the plurality of hard disks. The test method includes: writing data into the plurality of hard disks respectively, and generating first check information for the data in each hard disk; sequentially performing a variety of function tests on the storage domain expander; when the storage domain expander passes the variety of function tests, reading data from the plurality of hard disks respectively, and generating second check information for the data read from each hard disk; when the first check information and the second check information of the data in each hard disk are consistent, determining that the test passes.

[0005] The second aspect of this application provides a test device for a storage device. The storage device includes a plurality of hard disks and a storage domain expander connected to the plurality of hard disks. The test device includes: a writing module, configured to write data into the plurality of hard disks respectively, and generate first check information for the data in each hard disk; a test module, configured to sequentially perform a variety of function tests on the storage domain expander; a reading module, configured to, when the storage domain expander passes the variety of function tests, read data from the plurality of hard disks respectively, and generate second check information for the data read from each hard disk; a determining module, configured to determine that the test passes when the first check information and the second check information of the data in each hard disk are consistent.

[0006] The third aspect of this application provides an electronic device, including: one or more processors; a memory, configured to store one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the above method.

[0007] The fourth aspect of the present application further provides a computer-readable storage medium, on which computer programs or instructions are stored, and when the computer programs or instructions are executed by a processor, the steps of the above method are implemented.

[0008] The fifth aspect of the present application further provides a computer program product, including computer programs or instructions, and when the computer programs or instructions are executed by a processor, the steps of the above method are implemented.

[0009] According to the test method, device and equipment of the storage device provided by the present application, serial tests are performed on various functions of the storage domain extender in the storage device, that is, various function tests are sequentially performed on the storage domain extender to comprehensively verify the functions of the storage domain expansion domain, and when the storage domain extender passes various function tests, based on the first verification information and the second verification information generated by the data in each hard disk before and after various function tests, the data in each hard disk is verified to ensure that no data loss occurs in each hard disk during the various function tests, and the test accuracy of the storage domain extender is improved. Description of the Drawings

[0010] Through the following description of the embodiments of the present application with reference to the drawings, the above content and other objects, features and advantages of the present application will become clearer. In the drawings:

[0011] Figure 1 Schematically shows an application scenario diagram of the test method of the storage device according to an embodiment of the present application;

[0012] Figure 2 Schematically shows a flowchart of the test method of the storage device according to an embodiment of the present application;

[0013] Figure 3 Schematically shows a schematic diagram of a test system for executing the test method of the storage device according to an embodiment of the present application;

[0014] Figure 4 Schematically shows a flowchart of the test method of the storage device according to another embodiment of the present application;

[0015] Figure 5 Schematically shows a flowchart of testing the interface enable state of each slot according to an embodiment of the present application;

[0016] Figure 6 Schematically shows a flowchart of testing the interface connection state of each slot according to an embodiment of the present application;

[0017] Figure 7 Schematically shows a flowchart of testing the interface rate of each slot according to an embodiment of the present application;

[0018] Figure 8Schematically shows a flowchart of firmware upgrade and downgrade of a test storage domain expander according to an embodiment of the present application;

[0019] Figure 9 Schematically shows a structural block diagram of a test device for a storage device according to an embodiment of the present application; and

[0020] Figure 10 Schematically shows a block diagram of an electronic device suitable for implementing a test method for a storage device according to an embodiment of the present application. Detailed implementation manners

[0021] Hereinafter, embodiments of the present application will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present application. In the following detailed description, for the sake of explanation, many specific details are set forth in order to provide a comprehensive understanding of the embodiments of the present application. However, obviously, one or more embodiments can also be implemented without these specific details. In addition, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessarily confusing the concepts of the present application.

[0022] The terms used herein are merely for describing specific embodiments and are not intended to limit the present application. The terms "including", "comprising", etc. used herein indicate the presence of the described features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0023] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.

[0024] In the case of using expressions such as "at least one of A, B, and C", generally, it should be interpreted according to the meaning commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include, but not be limited to, a system having only A, only B, only C, having A and B, having A and C, having B and C, and / or having A, B, and C).

[0025] Existing test methods are not comprehensive and accurate enough for testing storage domain expanders. Traditional tests mostly focus on the physical connectivity of storage domain expanders and lack multi-faceted comprehensive tests. Manual testing of storage domain expanders is limited by the proficiency of operators and is prone to missing test scenarios, resulting in low test efficiency. To this end, embodiments of the present application provide a test method for a storage device to comprehensively test the functions of the storage domain expander in the storage device and improve test efficiency.

[0026] Figure 1 The application scenario diagram of the test method for a storage device according to an embodiment of the present application is schematically shown.

[0027] As Figure 1 shown, the application scenario 100 according to this embodiment may include a storage domain expander 110 and multiple hard disks. Among them, the multiple hard disks may be hard disk 1 to hard disk n, and the multiple hard disks are connected to the storage domain expander, where n is an integer greater than 1.

[0028] According to an embodiment of the present application, data can be written into the multiple hard disks respectively, and first check information can be generated for the data in each hard disk. A variety of function tests are performed on the storage domain expander 110 in sequence. In the case where the storage domain expander 110 passes a variety of function tests, data is read from the multiple hard disks respectively, and second check information is generated for the data read from each hard disk. In the case where the first check information and the second check information of the data in each hard disk are consistent, it is determined that the test passes.

[0029] The following will be based on Figure 1 the described scenario, and the test method for the storage device of the embodiment of the present application will be described in detail through Figures 2 to 8 ...

[0030] Figure 2 The flowchart of the test method for a storage device according to an embodiment of the present application is schematically shown.

[0031] Among them, the storage device may include multiple hard disks and a storage domain expander connected to the multiple hard disks. Then the test of the storage device includes the test of the storage domain expander in the storage device.

[0032] As Figure 2 shown, the method 200 includes operations S210 to S240.

[0033] In operation S210, data is written into the multiple hard disks respectively, and first check information is generated for the data in each hard disk.

[0034] According to an embodiment of the present application, before performing a variety of function tests on the storage domain expander, data is written into the multiple hard disks respectively, and first check information is generated for the data in each hard disk. Among them, data can be written into the multiple hard disks respectively through an input / output read / write tool. For example, the input / output read / write tool can be an input / output tool (I / O tool, Input / Output Tool), specifically, it can be a flexible input / output tester (FIO Tester, Flexible I / O Tester) or a virtual database benchmark tool (VDBENCH, Virtual Database Benchmark).

[0035] Among them, multiple hard disks can be hard disks of different models and different interface rates.

[0036] In operation S220, various function tests are sequentially performed on the storage domain expander.

[0037] According to the embodiments of the present application, in order to comprehensively test the storage domain expander, various function tests are sequentially performed on the storage domain expander. That is, the execution order of various function tests can be random, but various function tests cannot be performed simultaneously to avoid interference between various function tests resulting in inaccurate test results of function tests.

[0038] In operation S230, when the storage domain expander passes various function tests, data is read from multiple hard disks respectively, and second check information is generated for the data read from each hard disk.

[0039] According to the embodiments of the present application, when the storage domain expander passes various function tests, read verification is performed on the data written in operation S210 in multiple hard disks.

[0040] Specifically, data can be read from multiple hard disks respectively, and second check information is generated for the data read from each hard disk. Among them, data can be read from multiple hard disks through an input / output read / write tool.

[0041] In operation S240, when the first check information and the second check information of the data in each hard disk are both consistent, it is determined that the test passes.

[0042] According to the embodiments of the present application, based on the first check information and the second check information of the data in each hard disk, it can be verified whether there is a loss phenomenon in each hard disk during various function tests, thereby affecting the test results of various function tests. While verifying the data in each hard disk based on the first check information and the second check information, the data written in each hard disk in operation 210 can also be directly compared with the data read from each hard disk in operation S230 to further check whether there is a loss phenomenon in the data in each hard disk.

[0043] According to the embodiments of the present application, when the first check information and the second check information of the data in each hard disk are both consistent, it can be verified that there is no data loss phenomenon in each hard disk, and it can be determined that the test of the storage device passes, that is, it is determined that the test of the storage domain expander in the storage device passes.

[0044] In some embodiments, the storage device may be a storage device in a server, and the method of the embodiments of the present disclosure may be executed by a Baseboard Management Controller (BMC) in the server for monitoring and managing the server.

[0045] According to an embodiment of the present application, a serial test is performed on various functions of a storage domain expander in a storage device, that is, various function tests are sequentially performed on the storage domain expander to comprehensively verify the functions of the storage domain expansion domain. And when the storage domain expander passes various function tests, based on the first check information and the second check information generated from the data in each hard disk before and after various function tests, the data in each hard disk is verified to ensure that no data loss occurs in each hard disk during various function tests, thereby improving the test accuracy of the storage domain expander.

[0046] According to an embodiment of the present application, the various function tests include at least two of the following: testing the interface enable state of each slot; testing the interface connection state of each slot; testing the interface rate of each slot; testing the firmware upgrade and downgrade of the storage domain expander.

[0047] Figure 3 A schematic diagram of a storage device according to an embodiment of the present application is schematically shown.

[0048] As Figure 3 shown, the storage device 300 includes a memory 310 and hard disks 1 to hard disk n. The memory 310 includes a storage domain expander 110 and a hard disk backplane 320. A plurality of slots are provided on the hard disk backplane 320, that is, slot 320_1 to slot 320_n. The plurality of slots are connected to the plurality of hard disks in one-to-one correspondence. Thus, the plurality of hard disks are connected to the storage domain expander 110 through the hard disk backplane 320. And the BMC network of the storage device is also configured.

[0049] According to an embodiment of the present application, in order to test the storage domain expander under various test scenarios, the various function tests may include at least two of an interface enable state test, an interface connection state test, an interface rate test, and a firmware upgrade and downgrade test.

[0050] According to an embodiment of the present application, sequentially performing various function tests on the storage domain expander can comprehensively verify the functions of the storage domain expander from multiple aspects, making the test scenarios comprehensive and the test coverage comprehensive.

[0051] Before performing various function tests, the slot numbers, capacities, and interface rates of each hard disk can be recorded in a file to generate a configuration file.

[0052] Moreover, since the control instructions for different types of storage devices are different, it is necessary to first obtain the control instructions for the storage domain expander in the storage device to be tested, so as to perform various function tests on the storage domain expander based on the corresponding control instructions. Among them, the control instructions may include the network code, command code, and operation code for operating the storage domain expander.

[0053] The control instructions for the storage domain expander in the present application can be as shown in Table 1 below.

[0054] Table 1

[0055]

[0056] Before performing various function tests, the cross-platform command-line tool can also be placed in the operating system environment of the storage device and the executable permission can be added. This cross-platform command-line tool is used to remotely manage and monitor the server hardware status. For example, the cross-platform command-line tool can be the Intelligent Platform Management Interface Tool (IPMITOOL).

[0057] Figure 4 Schematically shows a flowchart of a test method for a storage device according to another embodiment of the present application.

[0058] The various function tests include an interface enable status test, an interface connection status test, an interface rate test, and a firmware upgrade and downgrade test. Taking the function tests of the storage domain expander in these four test scenarios as an example.

[0059] As Figure 4 shown, the method 400 includes operations S410 to S490.

[0060] In operation S410, data is written into multiple hard disks respectively, and first check information is generated for the data in each hard disk.

[0061] Among them, operation S410 is the above-mentioned operation S210.

[0062] In the above operation S220, various function tests are performed on the storage domain expander in sequence, that is, to determine whether the storage domain expander passes various function tests.

[0063] In operation S420, it is judged whether the interface enable status test is passed.

[0064] For example, the interface enable status of the slots on the hard disk backplane connected to the storage domain expander can be tested to determine whether the interfaces on the slots can be enabled or disabled normally. The interface enable status of the slots can be an enabled status or a disabled status. The enabled status indicates that the slot can be used, and the disabled status indicates that the slot cannot be used. When performing the interface enable status test, the interface enable status of the slot can be switched first (from the enabled status to the disabled status, or from the disabled status to the enabled status), and then it can be detected whether the number of times of switching the interface enable status of the slot increases accordingly, so as to test whether the slot has the normal ability to switch the enable status. If all slots have the normal ability to switch the enable status, it indicates that the storage domain expander has passed the interface enable status test.

[0065] In some embodiments, when multiple slots have all passed the interface enable status test, operation S430 can be executed to perform the next functional test; otherwise, operation S490 is executed to determine that the storage domain expander in the storage device has failed the test.

[0066] In operation S430, it is determined whether the interface connection status test is passed.

[0067] For example, the interface connection status of the slots on the hard disk backplane connected to the storage domain expander can be tested to determine whether the communication channel between the slot and the hard disk can be used normally. The interface connection status of the slot can be disconnected or connected. Disconnected indicates that the communication channel between the slot and the hard disk is closed (i.e., the hard disk is removed from the slot), and connected indicates that the communication channel between the slot and the hard disk is open (i.e., the hard disk is added to the slot). When performing the interface connection status test, the hard disk on the slot can be removed or the hard disk can be added to the slot, and it can be detected whether the interface connection status of the slot is correct, so as to detect whether the slot has a normal communication channel. If all slots have a normal communication channel, it indicates that the storage domain expander has passed the interface connection status test.

[0068] In some embodiments, when multiple slots have all passed the interface connection status test, operation S440 can be executed to perform the next functional test; otherwise, operation S490 is executed to determine that the storage domain expander in the storage device has failed the test.

[0069] In operation S440, it is determined whether the interface rate test is passed.

[0070] For example, the transmission capacity and performance of the interfaces on the slots can be determined by testing the interface rates of the slots on the hard disk backplane connected to the storage domain expander, so as to determine whether the interfaces on the slots are compatible with the hard disks. When performing the interface rate test, the interface rate of the slot can be detected by removing the hard disk on the slot or adding the hard disk to the slot, so as to detect whether the interface on the slot is compatible with the hard disk. If all slots are compatible with the corresponding hard disks, it indicates that the storage domain expander has passed the interface rate test.

[0071] In some embodiments, when multiple slots all pass the interface rate test, operation S450 may be executed to perform the next functional test; otherwise, operation S490 is executed to determine that the storage domain expander in the storage device has failed the test.

[0072] In operation S450, it is determined whether the firmware upgrade / downgrade test is passed.

[0073] For example, the stability and firmware version compatibility of the storage domain expander can be determined by testing the version numbers under firmware upgrade / downgrade of the storage domain expander and whether all hard disks are normally recognized. When performing the firmware upgrade / downgrade test, the storage domain expander can be solid-upgraded or solid-downgraded, and then it is detected whether all hard disks can be normally recognized after the upgrade / downgrade, so as to detect whether the storage domain expander has stability and firmware version compatibility. If the storage domain expander has stability and firmware version compatibility, it indicates that the storage domain expander has passed the firmware upgrade / downgrade test.

[0074] In some embodiments, when the storage domain expander passes the firmware upgrade / downgrade test, operation S460 may be executed to perform the next functional test; otherwise, operation S490 is executed to determine that the storage domain expander in the storage device has failed the test.

[0075] In operation S460, when the storage domain expander has passed multiple functional tests, data is read from multiple hard disks respectively, and second check information is generated for the data read from each hard disk.

[0076] Among them, operation S460 is the above-mentioned operation S230.

[0077] In operation S470, it is determined whether the first check information and the second check information of the data in each hard disk are consistent.

[0078] According to the embodiments of the present application, when the first check information and the second check information of the data in each hard disk are consistent, operation S480 is executed; when the first check information and the second check information of the data in at least one of the multiple hard disks are inconsistent, operation S490 is executed.

[0079] In operation S480, it is determined that the test is passed.

[0080] In operation S490, it is determined that the test fails.

[0081] According to an embodiment of the present application, if the first check information and the second check information of the data in at least one hard disk among multiple hard disks are inconsistent or at least one function test among multiple function tests fails, it is determined that the test fails.

[0082] According to an embodiment of the present application, it can be determined that the test of the storage domain expander passes only when the storage domain expander passes multiple function tests and the first check information and the second check information of the data in each hard disk are consistent; as long as the first check information and the second check information of the data in at least one hard disk among multiple hard disks are inconsistent or at least one function test among multiple function tests fails, it is determined that the test fails.

[0083] Figure 4 The types and order of the function tests shown in

[0084] Figure 5 are illustrative. Thus, the number of test types and the execution order of the function tests can be adjusted as needed.

[0085] As Figure 5 shown in

[0086] In operation S510, the number of changes in the interface enable state of the slot is queried to obtain a first count value.

[0087] For each slot on the hard disk backplane, a command to query the number of changes in the interface enable state (change count) of the interface on the slot is sent to query the number of changes in the interface enable state of the slot, and a first count value is obtained.

[0088] In one embodiment, according to the command address of a known cross-platform command-line tool, the cross-platform command-line tool is used through the baseboard management controller to send a command to query the number of changes in the interface enable state of the interface on the slot in a raw data (raw) in-band manner or a protocol extension (LANplus) network manner.

[0089] Among them, as can be seen from Table 1 above, for the command to query the number of changes in the interface enable state (change count), the register address is command code 0x21, and the status change count register address is operation code 0x03. Thus, based on network code 0X34, command code 0x21, and operation code 0x03, the number of changes in the interface enable state of the slot is queried.

[0090] In operation S520, set the interface enable status of the slot to off.

[0091] For example, a command to set the interface enable status to disabled can be sent to the interface on the slot to set the interface enable status of the slot to off.

[0092] In one embodiment, according to the command address of a known cross-platform command-line tool, the baseboard management controller uses the cross-platform command-line tool to send a command to set the interface enable status to disabled to the interface on the slot in an in-band raw data manner or a protocol extension network manner.

[0093] As can be seen from Table 1 above, for the command to set the interface enable status to off, the register address is command code 0x25, and the enable-off register address is operation code 0x00. Thus, based on network code 0X34, command code 0x25, and operation code 0x00, set the interface enable status of the slot to off.

[0094] In operation S530, query the interface enable status of the slot to obtain the first interface enable status.

[0095] For example, a command to query the interface enable status can be sent to the interface on the slot to query the interface enable status of the slot and obtain the first interface enable status.

[0096] In one embodiment, according to the command address of a known cross-platform command-line tool, the baseboard management controller uses the cross-platform command-line tool to send a command to query the interface enable status to the interface on the storage domain expander slot in an in-band raw data manner or a protocol extension network manner.

[0097] As can be seen from Table 1 above, for the command to query the interface enable status, the register address is command code 0x21, and the enable status register address is operation code 0x04. Thus, based on network code 0X34, command code 0x21, and operation code 0x04, query the interface enable status of the slot.

[0098] In the foregoing operation S520, set the interface enable status of the slot to off. If the first interface enable status obtained by querying in operation S530 is "disabled", it indicates that the interface enable status of the slot has been changed correctly. If the first interface enable status obtained by querying in operation S530 is not "disabled", it indicates that the interface enable status of the slot has not been changed correctly.

[0099] In operation S540, query the change count of the interface enable status of the slot to obtain the second count value.

[0100] For example, when the foregoing operation S530 indicates that the enable state change is correct, a command for querying the number of times the interface enable state changes can be sent to the interface on the slot again to query the number of times the interface enable state of the slot changes, and a second count value is obtained.

[0101] If the interface enable state was changed once in the foregoing operation S520 and the foregoing operation S530 indicates that the enable state change is correct, if the second count value obtained in operation S540 is increased by 1 relative to the first count value, it indicates that the number of changes is correct; otherwise, it indicates that the number of changes is incorrect.

[0102] In operation S550, the interface enable state of the slot is set to enabled.

[0103] For example, when the foregoing operation S540 indicates that the number of changes is correct, a command for setting the interface enable state to enabled can be sent to the interface on the slot to set the interface enable state of the slot to enabled.

[0104] In one embodiment, according to the command address of a known cross-platform command-line tool, the baseboard management controller uses the cross-platform command-line tool to send a command for setting the interface enable state to enabled to the interface on the slot in an original data in-band manner or a protocol extension network manner.

[0105] As can be seen from Table 1 above, for the command to set the interface enable state to enabled, the register address is command code 0x25 and the enable register address is operation code 0x01. Thus, based on network code 0X34, command code 0x25, and operation code 0x01, the interface enable state of the slot is set to enabled.

[0106] In operation S560, the interface enable state of the slot is queried to obtain a second interface enable state.

[0107] For example, a command for querying the interface enable state can be sent to the interface on the slot to query the interface enable state of the slot and obtain a second interface enable state.

[0108] If, in the foregoing operation S550, the interface enable state of the slot is set to enabled, and if the second interface enable state obtained by querying in operation S560 is "enabled", it indicates that the interface enable state of the slot has been changed correctly. If the second interface enable state obtained by querying in operation S560 is not "enabled", it indicates that the interface enable state of the slot has not been changed correctly.

[0109] In operation S570, the number of times the interface enable state of the slot changes is queried to obtain a third count value.

[0110] For example, when it is indicated in the foregoing operation S560 that the enable state change is correct, a command for querying the number of times the interface enable state changes can be sent to the interface on the slot again, so as to query the number of times the interface enable state of the slot changes and obtain a third count value.

[0111] If the interface enable state is changed once in the foregoing operation S550, and it is indicated in the foregoing operation S560 that the enable state change is correct, if the third count value obtained in operation S570 is increased by 1 relative to the second count value, it indicates that the number of changes is correct; otherwise, it indicates that the number of changes is incorrect.

[0112] In operation S580, determine whether the slot passes the interface enable state test according to the first interface enable state, the second interface enable state, the first count value, the second count value, and the third count value.

[0113] Thus, according to the first interface enable state, the second interface enable state, the first count value, the second count value, and the third count value, it can be determined whether the slot passes the interface enable state test.

[0114] Based on the foregoing operations S510 to S570, if the obtained first interface enable state is "enable off (disable)", the second interface enable state is "enable on (enable)", the second count value is 1 more than the first count value, and the third count value is 1 more than the second count value, it can be determined that the slot passes the interface enable state test. Otherwise, it is determined that the slot fails the interface enable state test. In other words, based on the foregoing operations S510 to S570, if the obtained result meets at least one of the following, it is determined that the slot fails the interface enable state test: the first interface enable state is not "enable off", the second interface enable state is not "enable on", the second count value is not 1 more than the first count value, and the third count value is not 1 more than the second count value.

[0115] To verify the interface enable state of the slot at high frequencies, the interface enable state test of the slot can be repeated a preset number of times. For example, the interface enable state test of the slot is repeated 10 times. Thus, in the case of performing the interface enable state test of the slot a preset number of times, in the interface enable state test of the preset number of times, the first interface enable state is "enable off", the second interface enable state is "enable on", the second count value is 1 more than the first count value, and the third count value is 1 more than the second count value, then it can be determined that the slot passes the interface enable state test.

[0116] According to the embodiments of the present application, when multiple slots all pass the interface enable state test, it is determined that the storage domain expander passes the interface enable state test.

[0117] According to an embodiment of the present application, for the interface enablement status test, based on the first interface enablement status and the second interface enablement status queried before and after the interface enablement status is closed and then opened, and the count value of the number of changes in the interface enablement status, the test of the interface enablement status of the storage domain expander can be achieved by verifying whether the changes in the interface enablement status and the number of changes are normal. During this process, the interface enablement status test can also be repeatedly executed a preset number of times for each slot to perform a stress test on the storage domain expander and verify the stability of the storage domain expander under large-pressure operations.

[0118] Figure 6 Schematically shows a flowchart for testing the interface connection status of each slot according to an embodiment of the present application.

[0119] As Figure 6 shown, for each slot, the method 600 includes operations S610 to S660.

[0120] In operation S610, obtain the device identifier of the hard disk on the slot.

[0121] During the process of testing the interface connection status of the slot, it is necessary to first list the device information of all the hard disks inserted on the hard disk backplane. The device information may include the device identifier, device type, driver program, etc. of the hard disk. For example, the device information of all the hard disks inserted on the hard disk backplane can be listed by using the command to list the interface devices. The so-called interface device (i.e., the hard disk) here can be a Small Computer System Interface (SCSI) device.

[0122] For each slot on the hard disk backplane, obtain the device identifier of the hard disk from the device information of the hard disk on the slot. For example, the device identifier may be [2:0:0:0].

[0123] In operation S620, remove the hard disk on the slot according to the device identifier.

[0124] Send a removal command to the hard disk on the slot according to the device identifier to remove the hard disk on the slot. Here, removing the hard disk on the slot means disconnecting the interface communication of the hard disk on the slot.

[0125] In one embodiment, through a virtual file, use the command to remove a single device (remove-single-device) to remove the hard disk corresponding to the device identifier.

[0126] Among them, the directory address of the virtual file is / proc / scsi / scsi to view the relevant information of SCSI devices under the directory; the virtual file can be the file that records device information generated by the command of listing interface devices in the above operation S610.

[0127] In operation S630, query the interface connection status of the slot to obtain the first interface connection status.

[0128] For example, a command to query the interface connection status (Link status) can be sent to the interface on the slot to query the interface connection status of the slot and obtain the first interface connection status.

[0129] In one embodiment, according to the command address of the known cross-platform command-line tool, the baseboard management controller uses the cross-platform command-line tool to send a command to query the interface connection status to the interface on the slot in the in-band manner of the raw data (raw data) or the protocol extension network manner.

[0130] Among them, as can be seen from Table 1 above, for the command to query the interface connection status, the register address is the command code 0x21, and the interface connection status register address is the operation code 0x01. Thus, based on the network code 0X34, the command code 0x21, and the operation code 0x01, the interface connection status of the slot is queried.

[0131] In the foregoing operation S620, remove the hard disk on the slot. If the first interface connection status obtained by querying in operation S630 is "Link Down", it indicates that the interface connection status of the slot has been correctly changed. If the first interface connection status obtained by querying in operation S630 is not "Link Down", it indicates that the interface connection status of the slot has not been correctly changed.

[0132] In operation S640, add the hard disk on the slot according to the device identifier.

[0133] For example, in the case where it is indicated in the foregoing operation S630 that the interface connection status has been correctly changed, a command to add can be sent to the hard disk on the slot according to the device identifier to add the hard disk to the slot. Among them, adding the hard disk on the slot refers to the interface communication for connecting the hard disk on the slot.

[0134] In one embodiment, through the virtual file, use the command to add a single device (add-single-device) to re-add the hard disk corresponding to the device identifier.

[0135] In operation S650, query the interface connection status of the slot to obtain the second interface connection status.

[0136] For example, a command to query the interface connection status can be sent to the interface on the slot to query the interface connection status of the slot and obtain the second interface connection status.

[0137] In the foregoing operation S640, if the hard disk is re-added and the second interface connection status queried in operation S650 is "Connected (Link UP)", it indicates that the interface connection status of the slot has been correctly changed. If the second interface connection status queried in operation S650 is not "Connected (Link UP)", it indicates that the interface connection status of the slot has not been correctly changed.

[0138] In operation S660, based on the first interface connection status and the second interface connection status, it is determined whether the slot passes the interface connection status test.

[0139] Thus, based on the first interface connection status and the second interface connection status, it can be determined whether the slot passes the interface connection status test.

[0140] Based on the above operations S610 to S650, the obtained first interface connection status is "Disconnected (LinkDown)" and the second interface connection status is "Connected (Link UP)", and it is determined that the slot passes the interface connection test.

[0141] However, based on the above operations S610 to S650, when the first interface connection status is not "Disconnected" or the second interface connection status is not "Connected", it is determined that the slot fails the interface connection test.

[0142] To verify the interface connection status of the slot at high frequencies, the interface connection status test can be repeated a preset number of times for the slot. For example, the interface connection status test is repeated 10 times for the slot. Thus, in the case of performing the interface connection status test on the slot a preset number of times, only when the first interface connection status is "Disconnected" and the second interface connection status is "Connected" in all the preset number of interface connection status tests can it be determined that the slot passes the interface connection status test.

[0143] According to an embodiment of the present application, when multiple slots all pass the interface connection status test, it is determined that the storage domain expander passes the interface connection status test.

[0144] According to an embodiment of the present application, for the interface connection status test, based on the first interface connection status and the second interface connection status queried before and after the hard disk on the slot is removed and added, the interface connection status of the storage domain expander can be tested by verifying whether the interface connection status is normal. During this process, the interface connection status test can also be reset and performed a preset number of times for each slot to perform a stress test on the storage domain expander and verify the stability of the storage domain expander under high-pressure operations.

[0145] Figure 7 Schematically shows a flowchart for testing the interface rate of each slot according to an embodiment of the present application.

[0146] As Figure 7 shown in, for each slot, the method 700 includes operations S710 to S770.

[0147] In operation S710, obtain the device identifier of the hard disk on the slot.

[0148] During the process of testing the interface connection status of the slot, it is necessary to first list the device information of all the hard disks inserted on the hard disk backplane. The device information may include the device identifier, device type, driver program, etc. of the hard disk. For example, the device information of all the hard disks inserted on the hard disk backplane can be listed by using the command for listing interface devices.

[0149] For each slot on the hard disk backplane, obtain the device identifier of the hard disk from the device information of the hard disk on the slot. For example, the device identifier may be [2:0:0:0].

[0150] In operation S720, remove the hard disk on the slot according to the device identifier.

[0151] According to the device identifier, send a removal command to the hard disk on the slot to remove the hard disk on the slot. Here, removing the hard disk on the slot means disconnecting the interface communication of the hard disk on the slot.

[0152] In one embodiment, through a virtual file, use the command for removing a single device to remove the hard disk corresponding to the device identifier.

[0153] In operation S730, query the interface rate of the slot to obtain a first interface rate.

[0154] For example, an interface rate query command can be sent to the interface on the slot to query the interface rate of the slot and obtain a first interface rate.

[0155] In one embodiment, according to the command address of a known cross-platform command-line tool, use the cross-platform command-line tool through the baseboard management controller to send an interface rate query command to the interface on the slot in an original data in-band manner or a protocol extension network manner.

[0156] Among them, as can be seen from Table 1 above, for the command for querying the interface rate, the register address is command code 0x21, and the interface rate register address is operation code 0x02. Thus, based on network code 0X34, command code 0x21, and operation code 0x02, query the interface rate of the slot.

[0157] In the foregoing operation S720, remove the hard disk on the slot. If the first interface rate queried in operation S730 is "0 Gbps (no connection)", it indicates that the interface rate of the slot has changed correctly. If the first interface rate queried in operation S730 is not "0 Gbps (no connection)", it indicates that the interface rate of the slot has not been changed correctly.

[0158] In operation S740, add the hard disk on the slot according to the device identifier.

[0159] For example, in the foregoing operation S730, when it is indicated that the interface rate change is correct, an add command can be sent to the hard disk on the slot according to the device identifier to add the hard disk to the slot. Herein, adding the hard disk on the slot refers to the interface communication for connecting the hard disk on the slot.

[0160] In one embodiment, through a virtual file, use the command for adding a single device to re-add the hard disk corresponding to the device identifier.

[0161] In operation S750, query the interface rate of the slot to obtain a second interface rate.

[0162] For example, an interface rate query command can be sent to the interface on the slot to query the interface rate of the slot and obtain a second interface rate.

[0163] In operation S760, query the preset interface rate of the hard disk on the slot in the configuration file.

[0164] Query the preset interface rate of the hard disk on the slot in the pre-configured configuration file.

[0165] In the foregoing operation S740, when the hard disk is re-added, if the second interface rate queried in operation S750 is consistent with the preset interface rate, it indicates that the interface rate of the slot is correctly compatible with the hard disk. If the second interface rate queried in operation S750 is not consistent with the preset interface rate, it indicates that the interface rate of the slot is not compatible with the hard disk.

[0166] In operation S770, determine whether the slot passes the interface rate test according to the first interface rate, the second interface rate, and the preset interface rate.

[0167] Thus, according to the first interface rate, the second interface rate, and the preset interface rate, it can be determined whether the slot passes the interface rate test.

[0168] Based on the foregoing operations S710 to S760, when the obtained first interface rate is "0 Gbps" and the second interface rate is consistent with the preset interface rate, it is determined that the slot passes the interface rate test.

[0169] However, when the first interface rate obtained based on the above operations S710 to S760 is not "0 Gbps" or the second interface rate is inconsistent with the preset interface rate, it is determined that the slot fails the interface rate test.

[0170] To verify the interface rate negotiated between the interface on the slot and both ends of the hard disk at high frequencies, the interface rate test on the slot can be repeated a preset number of times. For example, the interface rate test on the slot is repeated 10 times. Thus, when the interface rate test on the slot is performed a preset number of times, only when the first interface rate is "0 Gbps" (no connection) and the second interface rate is consistent with the preset interface rate in all the preset number of interface rate tests, can it be determined that the slot passes the interface rate test.

[0171] According to an embodiment of the present application, when multiple slots all pass the interface rate test, it is determined that the storage domain expander passes the interface rate test.

[0172] According to an embodiment of the present application, for the interface rate test, based on the first interface rate and the second interface rate queried before and after the removal and addition of the hard disk on the slot, and the preset interface rate of the hard disk on the slot recorded in the configuration file, it is possible to verify whether the interface rate on the slot is normal and whether it is compatible with the hard disk, thereby implementing the test of the interface rate of the storage domain expander. During this process, the interface connection status test can also be repeatedly executed a preset number of times for each slot to perform a stress test on the storage domain expander and verify the stability of the storage domain expander under large-pressure operations.

[0173] Figure 8 Schematically shows a flowchart for testing the firmware upgrade and downgrade of a storage domain expander according to an embodiment of the present application.

[0174] As Figure 8 shown in, the method 800 includes operations S810 to S870.

[0175] In operation S810, the storage domain expander is upgraded with firmware and reset after the upgrade.

[0176] For example, the storage domain expander can be upgraded with firmware and reset after the upgrade.

[0177] In one embodiment, a command-line tool (CLI, Command Line Interface) is used to perform a firmware upgrade operation on the storage domain expander firmware, and a firmware reset operation is performed after the upgrade is completed. This command-line tool is used to execute various state configurations, queries, and firmware upgrade and downgrade operations of the interface.

[0178] In operation S820, query the firmware version number of the storage domain expander after the upgrade to obtain the first firmware version number.

[0179] For example, the firmware version number of the storage domain expander after the upgrade can be queried to obtain the first firmware version number.

[0180] In the foregoing operation S810, upgrade the firmware of the storage domain expander. If the first firmware version number obtained by querying in operation S820 is the same as the firmware version number used for the upgrade, it indicates that the upgrade version number is correct. If the first firmware version number obtained by querying in operation S820 is inconsistent with the firmware version number used for the upgrade, it indicates that the storage domain expander has not been accurately upgraded.

[0181] In operation S830, query whether multiple hard disks are normally recognized by the upgraded storage domain expander to obtain the first recognition result.

[0182] For example, when it is shown in the foregoing operation S820 that the upgrade version number is correct, it can be queried whether multiple hard disks are normally recognized by the upgraded storage domain expander to obtain the first recognition result.

[0183] In an embodiment, a command for listing disk partitions can be used to query whether all hard disks are normally recognized. For example, the command for listing disk partitions can be fdisk –l to list the information of the disks and their partitions for querying whether the hard disks are normally recognized. Fdisk is a command-line tool for disk partitioning, and -1 is an option indicating to list the information of all disks.

[0184] If the first recognition result obtained by querying in operation S830 indicates that all hard disks have been normally recognized, it indicates that the upgrade is successful. If the first recognition result obtained by querying in operation S830 indicates that at least one hard disk among all hard disks is not normally recognized, it indicates that the storage domain expander has not been successfully upgraded.

[0185] In operation S840, downgrade the firmware of the storage domain expander and perform a firmware reset after the downgrade.

[0186] For example, when it is shown in the foregoing operation S830 that the upgrade is successful, the firmware of the storage domain expander can be downgraded and a firmware reset can be performed after the downgrade.

[0187] In an embodiment, use a command-line tool to perform a downgrade operation on the storage domain expander firmware and perform a firmware reset operation after the downgrade is completed.

[0188] In operation S850, query the firmware version number of the storage domain expander after the downgrade to obtain the second firmware version number.

[0189] For example, the firmware version number after the storage domain expander is downgraded can be queried to obtain the second firmware version number.

[0190] In the foregoing operation S840, the firmware of the storage domain expander is downgraded. If the second firmware version number obtained by querying in operation S850 is consistent with the firmware version number used for downgrading, it indicates that the downgraded version number is correct. If the second firmware version number obtained by querying in operation S850 is inconsistent with the firmware version number used for downgrading, it indicates that the storage domain expander has not been accurately downgraded.

[0191] In operation S860, it is queried whether multiple hard disks are normally recognized by the downgraded storage domain expander to obtain a second recognition result.

[0192] For example, in the case where the foregoing operation S850 indicates that the downgraded version number is correct, it can be queried whether multiple hard disks are normally recognized by the downgraded storage domain expander to obtain a second recognition result.

[0193] If the second recognition result obtained by querying in operation S860 indicates that all hard disks have been normally recognized, it indicates that the downgrade is successful. If the second recognition result obtained by querying in operation S860 indicates that at least one hard disk among all hard disks has not been normally recognized, it indicates that the storage domain expander has not been successfully downgraded.

[0194] In operation S870, according to the first firmware version number, the second firmware version number, the first recognition result, and the second recognition result, it is determined whether the storage domain expander passes the firmware upgrade / downgrade test.

[0195] Thus, according to the first firmware version number, the second firmware version number, the first recognition result, and the second recognition result, it is determined whether the storage domain expander passes the firmware upgrade / downgrade test.

[0196] Based on the foregoing operations S810 to S860, if the first firmware version number is consistent with the firmware version number used for upgrading, the second firmware version number is consistent with the firmware version number used for downgrading, and both the first recognition result and the second recognition result indicate that multiple hard disks have been normally recognized, it is determined that the storage domain expander passes the firmware upgrade / downgrade test.

[0197] However, based on the foregoing operations S810 to S860, if the first firmware version number is inconsistent with the firmware version number used for upgrading, or the second firmware version number is inconsistent with the firmware version number used for downgrading, or the first recognition result indicates that at least one hard disk among multiple hard disks has not been normally recognized, or the second recognition result indicates that at least one hard disk among multiple hard disks has not been normally recognized, it is determined that the storage domain expander fails the firmware upgrade / downgrade test.

[0198] To verify the firmware upgrade and downgrade of the storage domain expander at high frequencies, the firmware upgrade and downgrade test of the storage domain expander can be repeated a preset number of times. For example, perform the firmware upgrade and downgrade test of the storage domain expander 100 times. Thus, in the case of performing the firmware upgrade and downgrade test of the storage domain expander a preset number of times, in the firmware upgrade and downgrade test of the preset number of times, both the first firmware version number and the firmware version number used for upgrade are consistent, both the second firmware version number and the firmware version number used for downgrade are consistent, and both the first recognition result and the second recognition result indicate that multiple hard disks have been normally recognized, then it can be determined that the storage domain expander passes the firmware upgrade and downgrade test.

[0199] According to an embodiment of the present application, for the firmware upgrade and downgrade test of the storage domain expander, based on the first firmware version number and the second firmware version number after the upgrade and downgrade and whether all hard disks are normally recognized after the upgrade and downgrade, it is possible to verify whether the firmware upgrade and downgrade is normal, so as to implement the test of the firmware upgrade and downgrade of the storage domain expander. In this process, the firmware upgrade and downgrade test of the storage domain expander can also be repeatedly executed a preset number of times to perform a stress test on the storage domain expander and verify the stability of the storage domain expander under large-pressure operations.

[0200] According to an embodiment of the present application, generating the first check information for the data in each hard disk includes: applying a hash function to the data in each hard disk to obtain a first hash value as the first check information; generating the second check information for the data read from each hard disk includes: applying a hash function to the data read from each hard disk to obtain a second hash value as the second check information.

[0201] According to an embodiment of the present application, after writing data into multiple hard disks respectively, a hash function can be used to perform hash calculation on the data in each hard disk to generate the first hash value of the data in each hard disk. This first hash value can be used as the first check information.

[0202] According to an embodiment of the present application, when the storage domain expander passes various function tests, data is read from multiple hard disks respectively. A hash function can be used to perform hash calculation on the data read from each hard disk to generate the second hash value of the data in each hard disk. This second hash value can be used as the second check information.

[0203] According to the first hash value and the second hash value, it is possible to verify whether data in the hard disk is lost before and after performing various function tests.

[0204] For example, when the first hash value is consistent with the second hash value, it is verified that the data in the hard disk has not been lost before and after performing various function tests.

[0205] According to an embodiment of the present application, a first hash value is generated for the data written in each hard disk through a hash function as the first verification information, and a second hash value is generated for the data read from each hard disk as the second verification information. Since the hash values generated by applying the hash function are more efficient, fast, and secure, the comparison result of the first verification information and the second verification information is more accurate.

[0206] Based on the above, the test method of the storage device of the present application comprehensively tests various aspects such as the interface connection status, interface rate, interface enable status, status record of the number of changes in the interface enable status, firmware upgrade and downgrade, etc., fully verifying the functions of the storage domain expander in the storage device, and verifying the reliability and stability of the storage domain expander under high pressure through an automated test method. On this basis, the problem of incomplete parameter verification such as interface connection status, interface rate, and interface enable status in traditional tests is solved; the automated monitoring of the number of changes in the interface enable status is realized, and abnormal fluctuations in the interface enable status, such as frequent connection disconnections, can be captured; through the stable pressure test of firmware upgrade and downgrade, the stability of the firmware version switching function is ensured; the whole process realizes automated testing, reducing the risk of manual operation and improving the test efficiency and coverage.

[0207] Based on the above test method of the storage device, the present application also provides a test device for the storage device. The following will be combined with Figure 9 to describe this device in detail.

[0208] Figure 9 Schematically shows a structural block diagram of a test device for a storage device according to an embodiment of the present application.

[0209] As Figure 9 shown, the test device 900 for the storage device of this embodiment includes a writing module 910, a testing module 920, a reading module 930, and a determining module 940.

[0210] The writing module 910 is used to write data in multiple hard disks respectively and generate first verification information for the data in each hard disk. In one embodiment, the writing module 910 can be used to execute the operation S210 described above, which will not be elaborated here.

[0211] The testing module 920 is used to perform various function tests on the storage domain expander in sequence. In one embodiment, the testing module 920 can be used to execute the operation S220 described above, which will not be elaborated here.

[0212] The reading module 930 is used to read data from multiple hard disks respectively and generate second verification information for the data read from each hard disk when the storage domain expander passes various function tests. In one embodiment, the reading module 930 can be used to execute the operation S230 described above, which will not be elaborated here.

[0213] The determination module 940 is configured to determine that the test passes when the first check information and the second check information of the data in each hard disk are both consistent. In one embodiment, the determination module 940 may be configured to perform the operation S240 described above, which will not be elaborated herein.

[0214] According to an embodiment of the present application, the storage device further includes a hard disk backplane. A plurality of hard disks are connected to the storage domain expander through the hard disk backplane. A plurality of slots are provided on the hard disk backplane, and the plurality of slots are connected to the plurality of hard disks in a one-to-one correspondence; the test module 920 includes at least the following two units: a first test unit, a second test unit, a third test unit, and a fourth test unit.

[0215] The first test unit is configured to test the interface enable status of each slot.

[0216] The second test unit is configured to test the interface connection status of each slot.

[0217] The third test unit is configured to test the interface rate of each slot.

[0218] The fourth test unit is configured to test the firmware upgrade and downgrade of the storage domain expander.

[0219] According to an embodiment of the present application, the first test unit includes a first query subunit, a first setting subunit, a second query subunit, a third query subunit, a second setting subunit, a fourth query subunit, a fifth query subunit, and a first determination subunit.

[0220] The first query subunit is configured to query the change times of the interface enable status of the slot to obtain a first count value.

[0221] The first setting subunit is configured to set the interface enable status of the slot to off.

[0222] The second query subunit is configured to query the interface enable status of the slot to obtain a first interface enable status.

[0223] The third query subunit is configured to query the change times of the interface enable status of the slot to obtain a second count value.

[0224] The second setting subunit is configured to set the interface enable status of the slot to on.

[0225] The fourth query subunit is configured to query the interface enable status of the slot to obtain a second interface enable status.

[0226] The fifth query subunit is configured to query the change times of the interface enable status of the slot to obtain a third count value.

[0227] The first determination subunit is configured to determine whether the slot passes the interface enablement status test according to the first interface enablement status, the second interface enablement status, the first count value, the second count value, and the third count value.

[0228] According to an embodiment of the present application, the second test unit includes a first acquisition subunit, a first removal subunit, a sixth query subunit, a first addition subunit, a seventh query subunit, and a second determination subunit.

[0229] The first acquisition subunit is configured to acquire the device identifier of the hard disk on the slot.

[0230] The first removal subunit is configured to remove the hard disk on the slot according to the device identifier.

[0231] The sixth query subunit is configured to query the interface connection status of the slot to obtain the first interface connection status.

[0232] The first addition subunit is configured to add the hard disk on the slot according to the device identifier.

[0233] The seventh query subunit is configured to query the interface connection status of the slot to obtain the second interface connection status.

[0234] The second determination subunit is configured to determine whether the slot passes the interface connection status test according to the first interface connection status and the second interface connection status.

[0235] According to an embodiment of the present application, the third test unit includes a second acquisition subunit, a second removal subunit, an eighth query subunit, a second addition subunit, a ninth query subunit, a tenth query subunit, and a third determination subunit.

[0236] The second acquisition subunit is configured to acquire the device identifier of the hard disk on the slot.

[0237] The second removal subunit is configured to remove the hard disk on the slot according to the device identifier.

[0238] The eighth query subunit is configured to query the interface rate of the slot to obtain the first interface rate.

[0239] The second addition subunit is configured to add the hard disk on the slot according to the device identifier.

[0240] The ninth query subunit is configured to query the interface rate of the slot to obtain the second interface rate.

[0241] The tenth query subunit is configured to query the preset interface rate of the hard disk on the slot in the configuration file.

[0242] The third determination subunit is configured to determine whether the slot passes the interface rate test according to the first interface rate, the second interface rate, and the preset interface rate.

[0243] According to an embodiment of the present application, the fourth test unit includes an upgrade subunit, an eleventh query subunit, a twelfth query subunit, a downgrade subunit, a thirteenth subunit, a fourteenth subunit, and a fourth determination subunit.

[0244] The upgrade subunit is configured to upgrade the firmware of the storage domain expander and perform firmware reset after the upgrade;

[0245] The eleventh query subunit is configured to query the firmware version number of the storage domain expander after the upgrade to obtain a first firmware version number;

[0246] The twelfth query subunit is configured to query whether multiple hard disks are normally recognized by the upgraded storage domain expander to obtain a first recognition result;

[0247] The downgrade subunit is configured to downgrade the firmware of the storage domain expander and perform firmware reset after the downgrade;

[0248] The thirteenth subunit is configured to query the firmware version number of the storage domain expander after the downgrade to obtain a second firmware version number;

[0249] The fourteenth subunit is configured to query whether multiple hard disks are normally recognized by the downgraded storage domain expander to obtain a second recognition result;

[0250] The fourth determination subunit is configured to determine whether the storage domain expander passes the firmware upgrade / downgrade test according to the first firmware version number, the second firmware version number, the first recognition result, and the second recognition result.

[0251] According to an embodiment of the present application, the determination module 940 of the test device 900 is further configured to determine that the test fails if the first verification information and the second verification information of the data in at least one of the multiple hard disks are inconsistent or at least one of the multiple function tests fails.

[0252] According to an embodiment of the present application, the writing module 910 includes a first obtaining unit.

[0253] The first obtaining unit is configured to apply a hash function to the data in each hard disk to obtain a first hash value as the first verification information.

[0254] According to an embodiment of the present application, the reading module 930 includes a second obtaining unit.

[0255] The second obtaining unit is configured to generate second verification information for the data read from each hard disk, including: applying a hash function to the data read from each hard disk to obtain a second hash value as the second verification information.

[0256] According to an embodiment of the present application, any multiple of the writing module 910, the testing module 920, the reading module 930, and the determining module 940 may be combined and implemented in one module, or any one of them may be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules may be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present application, at least one of the writing module 910, the testing module 920, the reading module 930, and the determining module 940 may be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on chip, a system on substrate, a system on package, an application specific integrated circuit (ASIC), or any other reasonable way of integrating or packaging circuits, etc., implemented by hardware or firmware, or implemented in any one of the three implementation manners of software, hardware, and firmware, or in an appropriate combination of any several of them. Alternatively, at least one of the writing module 910, the testing module 920, the reading module 930, and the determining module 940 may be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding functions may be executed.

[0257] Figure 10 A block diagram of an electronic device suitable for implementing a test method for a storage device according to an embodiment of the present application is schematically shown.

[0258] As Figure 10 shown, the electronic device 1000 according to an embodiment of the present application includes a processor 1001, which may perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage section 1008 into a random access memory (RAM) 1003. The processor 1001 may include, for example, a general microprocessor (such as a CPU), an instruction set processor, and / or a related chipset, and / or a dedicated microprocessor (such as an application specific integrated circuit (ASIC)), etc. The processor 1001 may also include on-board memory for caching purposes. The processor 1001 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present application.

[0259] In the RAM 1003, various programs and data required for the operation of the electronic device 1000 are stored. The processor 1001, the ROM 1002, and the RAM 1003 are connected to each other via the bus 1004. The processor 1001 performs various operations of the method flow according to the embodiments of the present application by executing the programs in the ROM 1002 and / or the RAM 1003. It should be noted that the programs can also be stored in one or more memories other than the ROM 1002 and the RAM 1003. The processor 1001 can also perform various operations of the method flow according to the embodiments of the present application by executing the programs stored in the one or more memories.

[0260] According to an embodiment of the present application, the electronic device 1000 may further include an input / output (I / O) interface 1005, and the input / output (I / O) interface 1005 is also connected to the bus 1004. The electronic device 1000 may further include one or more of the following components connected to the input / output (I / O) interface 1005: an input part 1006 including a keyboard, a mouse, etc.; an output part 1007 including, for example, a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and a speaker, etc.; a storage part 1008 including a hard disk, etc.; and a communication part 1009 including a network interface card such as a LAN card, a modem, etc. The communication part 1009 performs communication processing via a network such as the Internet. The drive 1010 is also connected to the input / output (I / O) interface 1005 as needed. A removable medium 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1010 as needed so that a computer program read from it can be installed into the storage part 1008 as needed.

[0261] The present application also provides a computer-readable storage medium, which may be included in the device / device / system described in the above embodiments; or may exist separately without being assembled into the device / device / system. The above computer-readable storage medium carries one or more programs, and when the one or more programs are executed, the method according to the embodiments of the present application is implemented.

[0262] According to an embodiment of the present application, the computer-readable storage medium may be a non-volatile computer-readable storage medium, which may include, for example, but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In the present application, the computer-readable storage medium may be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, device, or apparatus. For example, according to an embodiment of the present application, the computer-readable storage medium may include the above-described ROM 1002 and / or RAM 1003 and / or one or more memories other than ROM 1002 and RAM 1003.

[0263] An embodiment of the present application also includes a computer program product, which includes a computer program that contains program code for executing the method shown in the flowchart. When the computer program product runs in a computer system, the program code is used to enable the computer system to implement the test method for the storage device provided by the embodiment of the present application.

[0264] When the computer program is executed by the processor 1001, it executes the above functions defined in the system / apparatus of the embodiment of the present application. According to an embodiment of the present application, the above-described systems, apparatuses, modules, units, etc. can be implemented by computer program modules.

[0265] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices and magnetic storage devices. In another embodiment, the computer program may also be transmitted and distributed in the form of a signal on a network medium, and be downloaded and installed through the communication part 1009, and / or be installed from the removable medium 1011. The program code included in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0266] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1009, and / or be installed from the removable medium 1011. When the computer program is executed by the processor 1001, it executes the above functions defined in the system of the embodiment of the present application. According to an embodiment of the present application, the above-described systems, devices, apparatuses, modules, units, etc. can be implemented by computer program modules.

[0267] In accordance with embodiments of the present application, program code for executing the computer programs provided by the embodiments of the present application may be written in any combination of one or more programming languages. Specifically, these computing programs may be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, programming languages such as Java, C++, Python, the "C" language, or similar programming languages. The program code may be executed entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user's computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., by connecting through the Internet using an Internet service provider).

[0268] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than that marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, and combinations of blocks in the block diagram or flowchart, may be implemented by a dedicated hardware-based system for performing the specified functions or operations, or may be implemented by a combination of dedicated hardware and computer instructions.

[0269] Those skilled in the art can understand that the features described in the various embodiments of the present application can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in the present application. In particular, without departing from the spirit and teachings of the present application, the features described in the various embodiments of the present application can be combined and / or combined in various ways. All such combinations and / or combinations fall within the scope of the present application.

[0270] The above describes the embodiments of the present application. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of the present application. Although the embodiments are described separately above, this does not mean that the measures in each embodiment cannot be used advantageously in combination. Without departing from the scope of the present application, those skilled in the art can make various substitutions and modifications, and all such substitutions and modifications should fall within the scope of the present application.

Claims

1. A test method for a storage device, the storage device comprising a plurality of hard disks and a storage domain extender connected to the plurality of hard disks, characterized in that, The method includes: Writing data into the multiple hard disks respectively, and generating first check information for the data in each hard disk; Performing multiple function tests on the storage domain expander in sequence; When the storage domain expander passes the multiple function tests, reading data from the multiple hard disks respectively, and generating second check information for the data read from each hard disk; When the first check information and the second check information of the data in each hard disk are consistent, determining that the test passes.

2. The method according to claim 1, wherein The storage device further includes a hard disk backplane. The multiple hard disks are connected to the storage domain expander through the hard disk backplane. A plurality of slots are provided on the hard disk backplane, and the plurality of slots are connected to the multiple hard disks in one-to-one correspondence. The multiple function tests include at least two of the following: Testing the interface enable status of each slot; Testing the interface connection status of each slot; Testing the interface rate of each slot; Testing the firmware upgrade and downgrade of the storage domain expander.

3. The method according to claim 2, wherein The testing of the interface enable status of each slot includes: for each slot, Querying the change times of the interface enable status of the slot to obtain a first count value; Setting the interface enable status of the slot to off; Querying the interface enable status of the slot to obtain a first interface enable status; Querying the change times of the interface enable status of the slot to obtain a second count value; Setting the interface enable status of the slot to on; Querying the interface enable status of the slot to obtain a second interface enable status; Querying the change times of the interface enable status of the slot to obtain a third count value; Determining whether the slot passes the interface enable status test according to the first interface enable status, the second interface enable status, the first count value, the second count value and the third count value.

4. The method according to claim 2, wherein The testing of the interface connection status of each slot includes: for each slot, Obtaining the device identifier of the hard disk on the slot; Removing the hard disk on the slot according to the device identifier; Querying the interface connection status of the slot to obtain a first interface connection status; Adding the hard disk on the slot according to the device identifier; Querying the interface connection status of the slot to obtain a second interface connection status; Determining whether the slot passes the interface connection status test according to the first interface connection status and the second interface connection status.

5. The method according to claim 2, wherein The testing of the interface rate of each slot includes: for each slot, Obtaining the device identifier of the hard disk on the slot; Removing the hard disk on the slot according to the device identifier; Querying the interface rate of the slot to obtain a first interface rate; Adding the hard disk on the slot according to the device identifier; Querying the interface rate of the slot to obtain a second interface rate; Querying the preset interface rate of the hard disk on the slot in the configuration file; Determining whether the slot passes the interface rate test according to the first interface rate, the second interface rate and the preset interface rate.

6. The method according to claim 2, wherein Testing the firmware upgrade and downgrade of the storage domain expander includes: Upgrading the firmware of the storage domain expander and performing a firmware reset after the upgrade; Querying the firmware version number after the upgrade of the storage domain expander to obtain a first firmware version number; Querying whether the multiple hard disks are normally recognized by the upgraded storage domain expander to obtain a first recognition result; Perform firmware downgrade on the storage domain expander and perform firmware reset after downgrade; Query the firmware version number of the storage domain expander after downgrade to obtain the second firmware version number; Query whether the multiple hard disks are normally recognized by the storage domain expander after downgrade to obtain the second recognition result; Determine whether the storage domain expander passes the firmware upgrade / downgrade test according to the first firmware version number, the second firmware version number, the first recognition result and the second recognition result.

7. The method according to claim 1, wherein The method further includes: If the first check information and the second check information of the data in at least one of the multiple hard disks are inconsistent or at least one of the multiple function tests fails, determine that the test fails.

8. The method according to any one of claims 1 to 7, characterized in that, Generating first check information for the data in each hard disk includes: applying a hash function to the data in each hard disk to obtain a first hash value as the first check information; Generating second check information for the data read from each hard disk includes: applying a hash function to the data read from each hard disk to obtain a second hash value as the second check information.

9. A test device for a storage device, the storage device including a plurality of hard disks and a storage domain expander connected to the plurality of hard disks, characterized in that, The device includes: A writing module, configured to write data into the multiple hard disks respectively and generate first check information for the data in each hard disk; A testing module, configured to perform multiple function tests on the storage domain expander in sequence; A reading module, configured to read data from the multiple hard disks respectively and generate second check information for the data read from each hard disk when the storage domain expander passes the multiple function tests; A determining module, configured to determine that the test passes when the first check information and the second check information of the data in each hard disk are consistent.

10. An electronic device, comprising: One or more processors; A memory, configured to store one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 8.