CN112463472B - Automatic testing method and device for disk array, electronic equipment and storage medium - Google Patents

Automatic testing method and device for disk array, electronic equipment and storage medium Download PDF

Info

Publication number
CN112463472B
CN112463472B CN202011188521.6A CN202011188521A CN112463472B CN 112463472 B CN112463472 B CN 112463472B CN 202011188521 A CN202011188521 A CN 202011188521A CN 112463472 B CN112463472 B CN 112463472B
Authority
CN
China
Prior art keywords
disk
test
disks
disk array
file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011188521.6A
Other languages
Chinese (zh)
Other versions
CN112463472A (en
Inventor
李建鸿
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202011188521.6A priority Critical patent/CN112463472B/en
Publication of CN112463472A publication Critical patent/CN112463472A/en
Application granted granted Critical
Publication of CN112463472B publication Critical patent/CN112463472B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2205Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2273Test methods

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

The invention provides an automatic test method, a device, electronic equipment and a storage medium of a disk array, belonging to the technical field of servers, which is characterized in that after the preparation work of test hardware is finished, an original file with preset capacity and a first MD5 check code corresponding to the original file are generated on target equipment based on a pre-stored test script, the method is an automatic test script, simulates a real test scene after the server is online, can provide a pressure test before the server of an IT personnel computer room is online, or a hard disk manufacturer hard disk compatibility test, or a disk array card manufacturer board card compatibility test, and a disk array card manufacturer soft firmware compatibility test, and in addition, a storage type server with multiple hard disks needs to spend a large amount of time and resources for testing, the invention can save the time cost of manpower setting, and the labor payment also can be the cost of wages, the error caused by manual setting is avoided, and the overall testing efficiency is improved.

Description

Automatic testing method and device for disk array, electronic equipment and storage medium
Technical Field
The invention relates to the technical field of servers, in particular to an automatic testing method and device of a disk array, electronic equipment and a storage medium.
Background
Since a computer system starts, a hard disk is an indispensable component, no matter an operating system or data storage, the hard disk must be relied on, as a network advances to a cloud computing generation, a lot of electronic service data are transmitted, and the importance of data storage is emphasized, a server needs to face to data access of a large number of network clients, a large number of users provide specific services after being online, and even the server needs to continuously work for 7 × 24 hours, so the importance of keeping the data of the server system stable is needless to say, once the data is damaged and lost, the server system is stopped, and the loss and influence caused by the data are difficult to calculate. Since data storage is so important, IT is an important task for IT personnel to regularly backup data, however, only the backup data is needed, when the hard disk is damaged, the system must be taken off-line to restore the file data, which is not only labor-consuming but also time-consuming, and still cannot satisfy the necessary condition that the server must provide services on-line at any time.
RAID is also known as disk array. Briefly, RAID is a disk with a fault tolerance mechanism. The single hard disk has no fault tolerance mechanism, and any part of the hard disk fails when the fault occurs, however, when the fault occurs, the service which is running on the hard disk is interrupted, and the data disappears. This is very unboosted for the user to use and therefore a RAID mechanism is created. The principle is that an array mode is used as a magnetic disk set, and the data safety is improved by matching with the design of data scattered arrangement. The disk array is a large disk set composed of a plurality of inexpensive, small-capacity, high-stability and slow-speed disks, and the performance of the whole disk system is improved by the additive effect generated by providing data by individual disks. Meanwhile, when data is stored, the data is cut into a plurality of sections by using the technology and the sections are respectively stored on the hard disks. The disk array can also utilize the concept of Parity Check (Parity Check), when any hard disk in the array fails, data can still be read out, and when the data is reconstructed, the data in the failed hard disk is calculated and then is re-placed into a new hard disk.
RAID5 requires at least 3 hard disks, the same-bit data of which is not fixed to the same hard disk, and stores the data and the corresponding parity information in an alternating manner on the respective disks constituting RAID5, and the parity information and the corresponding data are stored on different disks, respectively, where any (N-1) disk stores complete data, that is, there is a space equivalent to a disk capacity for storing parity information. Therefore, when one disk of RAID5 is damaged, the integrity of data is not affected, thereby ensuring the data security. When the damaged disk is replaced, the RAID will also automatically use the remaining parity information to reconstruct the data on that disk to maintain the high reliability of RAID 5.
In order to make the disk array repair itself immediately when the disk array is broken first, Hot Spare (Hot Spare) technology is used, and Hot Spare is used, namely, when a used disk fails, a Spare, powered-up and standby disk replaces the failed disk immediately, and the method is Hot Spare. The hot spare disk does not store any user data thereon. A hot spare disk may be dedicated to a single redundant array or it may be a portion of the entire array hot spare disk pool. While in a particular array there can only be one hot spare disk. When the disk fails, the firmware of the controller can automatically replace the failed disk with the hot spare disk and rebuild the data originally stored on the failed disk to the hot spare disk through an algorithm. Data can only be reconstructed from logical drives with redundancy and the hot spare disk must have sufficient capacity. The system administrator may replace the failed disk and designate the replaced disk as the new hot spare disk.
With the increase of network speed and users, the amount of data stored in servers is increasing, the demand of hard disk capacity is also increasing by multiple times, many server manufacturers have released storage servers, i.e. servers with multiple hard disks as a framework, the number of hard disks is 12 as small as 12, and more hard disks can reach hundreds, manufacturers can continuously perform pressure tests on server storage equipment during research and development manufacturing processes to ensure system stability, or data center IT personnel can perform stability tests on servers before servers are online to avoid machine crash or system halt caused by taking down a large number of files from servers, wherein testing the functionality of disk arrays and hot standby often requires a lot of manpower and material resources, and unnecessary time and manpower waste is caused by errors in manual setting.
No matter the server or the hard disk production manufacturer, in the research and development and manufacturing process, the pressure test can be continuously performed on the storage hardware of the server system to ensure the stability of the system, or the data center IT personnel can perform the stability test on the server before the server is on line to avoid that the server is in a state of crash of a machine or system halt due to the fact that a large number of files are stored, accessed and copied to influence the whole user rights and interests. More particularly, the functionality of the disk array is important to ensure that the hot standby mechanism can be started normally, and the integrity of the file system can be protected in the state that the hard disk is damaged.
FIG. 3 of the present application is a schematic diagram of a conventional manual testing process described in the present patent, which is a testing process using manual techniques, S301 is a preparation of testing environment, S302 is an installation of operating system to U disk, S303 generates a 100GB file in U disk by command, S304 records MD5 check code of 100GB file, S305 creates disk array, S306 sets hot spare hard disk, S307 formats disk array as available file system, S308 copies U disk 100G file to disk array, S309 manually pulls out 1 hard disk of disk array during continuous copying of file, S310 disk array disk will automatically add hot spare hard disk and rebuild, S311 continues copying file, disk array simultaneously rebuilds rebuild, S312 until file copying is completed, disk array rebuild is completed, MD5 check code of file is compared, S313 returns to S305, and creates disk array with a second group, setting another different hard disk as hot spare until all hard disks have been executed with overheat removal and hot spare, S314 indicates that the tester must look at the screen to understand the progress and test result, which is the most traditional manual test method.
Therefore, many automated testing methods have been summarized by the shortcomings of the above techniques:
patent application publication No. CN 106598794 a discloses a test system and a test method for a hard disk of a storage system. The test system and the test method for the storage system hard disk are provided, the hard disk information of the storage system is automatically captured through the hard disk information reading module, and whether the hard disk configuration is correct or not is confirmed according to the production task list; and then randomly extracting any hard disk in the array hard disk group, displaying the position information of the hard disk to be tested, then detecting whether the extracted hard disk to be tested is subjected to module plugging and unplugging inspection, and automatically storing a test record after the plugging and unplugging test of all the hard disks to be tested is determined.
The steps described in the above-mentioned patent application,
step 1): the hard disk information reading module acquires hard disk information of all hard disks on the back plate;
step 2): the hard disk information confirming module confirms whether the hard disk on the backboard is correctly configured or not according to the hard disk information read by the hard disk information reading module and by combining with a specific production task confirming sheet, if the configuration is correct, the step 3) is carried out, and if not, the step 1) is carried out;
step 3): confirming that a test hard disk module randomly extracts and confirms a plurality of hard disks of the array hard disk group on the back plate as hard disks to be detected;
step 4): the display detection hard disk information module displays the position information of the hard disk to be detected;
step 5): performing plug-in test on the hard disk to be detected;
step 6): judging whether the hard disk to be detected is plugged and unplugged, if not, turning to the step 5), otherwise, turning to the step 7);
step 7): giving out the detection result of the hard disk to be detected and storing the detection record
In step 5, the hard disk to be tested still needs to be operated and recorded manually, so that the requirement of automatic test cannot be met, and the randomly extracted test method does not conform to the systematic operation method, so that the test standard cannot be unified.
The invention discloses a solid state disk testing device and a method, which utilize a main controller to obtain product basic information of a solid state disk to be tested, carry out read-write interaction test on the solid state disk to be tested, judge whether the solid state disk to be tested works normally or not, and generate a test report and test progress information. This patent reports test report and progress information with voice prompt, only is applicable to a small amount of system tests, if be used for a large amount of machine tests to go on, voice broadcast will interfere with each other, if the tester is not on the scene, only report once or repeated broadcast always, do not have any convenience.
The patent application with application publication number CN 102637141 a discloses an automatic RAID testing system and method for testing the degradation reconstruction function of a RAID formed by the disk arrays to be tested, and the system includes: the creating module is used for creating an RAID volume for the disk array to be tested; the checking module is used for checking whether the state of the RAID volume is normal or not; the execution module is used for invalidating the entity disks in the disk array to be tested one by one when the state of the RAID volume is normal; the checking module is further configured to check whether the RAID volume is in a degraded state every time one physical disk is invalidated; the execution module is further configured to enable the invalid entity disk in the disk array to be tested to be valid when the RAID volume is in a degraded state; the creating module is further used for reconstructing the RAID volume after the invalid entity disk in the disk array to be tested is enabled to be valid again; the checking module is further configured to check whether the status of each reconstructed RAID volume is normal after the invalidated entity disks are validated one by one and the RAID volumes are reconstructed, and if the status of each reconstructed RAID volume is normal, the degraded reconstruction function of the RAID constructed by the disk array to be measured is normal. This patent only tests the establishment of RAID and makes RAID invalid, and has no file transmission test, which is not in accordance with the actual situation of use, and for the user or the server in the computer room, after the server is established online, there is inevitably the transmission access of files, and the test should include file integrity verification, so as to verify the real functionality of RAID.
Disclosure of Invention
The invention aims to provide an automatic test method, a device, electronic equipment and a storage medium of a disk array, which improve the test method of the traditional disk and disk array, replace the manual one-by-one setting method with an automatic script, solve the inconvenience and time consumption of the traditional manual test method, avoid the error caused by manual setting, improve the whole test efficiency, really achieve a full-automatic test method, and simultaneously improve the defects of the disclosed invention patent, in the automatic script, a check code for comparing a copied file and an original file can be automatically generated, a hard disk in the disk array is automatically removed, the disk array is in a reduced mode, and automatically rebuilt (rebuilt) with a hot spare hard disk, the cycle test of all hard disks is automatically completed, the test result can be informed by a lamp number, if fail exists in the test process, all the hard disks are lightened as red lamps by an instruction, if all the cycles test is finished the Pass, the command makes all the hard disk status lights constantly on for 3 seconds and go out for 1 second without interruption until the operator stops the script, the tester does not need to look at the screen to know the test result, and the notification of the light message can give play to the benefit in the test of multiple servers. The testing completion time point can be estimated, a tester usually needs to test hard disks of different manufacturers or a plurality of servers at the same time, and the tester can arrange a testing plan through the estimated time, so that the resources can be distributed and utilized most effectively.
In a first aspect, the present invention provides an automated testing method for a disk array, including:
after the preparation work of the testing hardware is finished, generating an original file with a preset capacity and a first MD5 check code corresponding to the original file on target equipment based on a pre-stored testing script;
selecting one disk from N disks as a hot standby disk based on the test script, and establishing a disk array based on the unselected N-1 disks;
repeatedly executing the following steps:
formatting the disk array into a file system based on the test script;
in the process of copying the original file to the file system, removing any disk in the disk array based on the test script, and adding the hot spare disk to the disk array for reconstruction until the disk array reconstruction is completed and the original file copying is completed, so as to obtain a copied file and a second MD5 check code corresponding to the copied file;
comparing the first MD5 check code with the second MD5 check code based on the test script to obtain a comparison result;
when the comparison results are the same, determining the hot spare disk as a tested disk, reselecting a disk from untested disks as the hot spare disk, and rebuilding a disk array; the untested magnetic disk is the other magnetic disk except the tested magnetic disk in the N magnetic disks;
until reaching the circulation stop condition; wherein the cycle stop condition is: and each disk in the N disks is used as a hot spare disk to be tested to obtain all comparison results, or the comparison results are different in the testing process.
Further, the method further includes:
recording an initial copying time before copying the original archive to the archive system; wherein, the copy initial time is used for representing the time of starting the test of the single disk;
when the comparison results are the same, recording the copying ending time; wherein, the copying end time is used for representing the time when the single disk completes the test;
determining the test period duration of the tested disk based on the copying initial time and the copying finishing time;
and estimating the residual time required by the test based on the test cycle duration of the tested disk, and displaying the residual time required by the test on a target display screen.
Further, the method further includes:
and when the comparison results are different, determining that the test results of the N disks are test failures.
Further, the method further includes:
after the circulation stops, if all the comparison results are the same, determining that the test results of the N disks are successful.
Further, the method further includes:
and displaying the test result by utilizing the indicator lamps on the N disks based on a preset display mode.
Further, the test hardware preparation comprises: performing communication connection on the N disks and a server for executing the test script, and installing a server operating system on the target equipment; wherein, the target device is a USB flash disk.
Further, the disk array is a RAID5 disk array.
In a second aspect, the present invention further provides an automatic testing apparatus for a disk array, including:
the generating unit is used for generating an original file with a preset capacity and a first MD5 check code corresponding to the original file on target equipment based on a pre-stored test script after the preparation work of the test hardware is finished;
the selection establishing unit is used for selecting one disk from the N disks to serve as a hot standby disk based on the test script and establishing a disk array based on the unselected N-1 disks;
a test unit for performing the following steps until a cycle stop condition is reached; wherein the cycle stop condition is: each disk in the N disks is used as a hot spare disk to be tested or the comparison result is different:
formatting the disk array into a file system based on the test script;
in the process of copying the original file to the file system, removing any disk in the disk array based on the test script, and adding the hot spare disk into the disk array for reconstruction until the disk array reconstruction is completed and the original file is copied, so as to obtain a copied file and a second MD5 check code corresponding to the copied file;
comparing the first MD5 check code with the second MD5 check code based on the test script to obtain a comparison result;
when the comparison results are the same, determining the hot spare disk as a tested disk, reselecting a disk from untested disks as the hot spare disk, and reestablishing a disk array; and the untested magnetic disk is the other magnetic disk except the tested magnetic disk in the N magnetic disks.
In a third aspect, the present invention further provides an electronic device, which includes a memory and a processor, where the memory stores a computer program operable on the processor, and the processor implements the steps of the automated testing method for a disk array when executing the computer program.
In a fourth aspect, the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores thereon a computer program, and the computer program, when executed by a processor, implements the steps of the automated testing method for a disk array.
The invention provides an automatic test method of a disk array, which comprises the steps of automatically testing a script, simulating a real test scene after a server is online, providing a pressure test before an IT personnel room server is online, or a hard disk manufacturer hard disk compatibility test, or a disk array card manufacturer board card compatibility test, and testing the soft and firmware compatibility of the disk array card manufacturer.
Accordingly, the automatic testing device for a disk array, the electronic device and the computer-readable storage medium provided by the embodiment of the invention also have the technical effects.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a schematic overall flow chart of a method for automatically testing a disk array and a hard disk for a multi-hard-disk server according to the present invention;
FIG. 2 is a schematic view of the structure of the present invention;
FIG. 3 is a schematic diagram of a conventional manual testing process according to the present invention;
FIG. 4 is a diagram illustrating an application environment of a server under test according to the present invention;
FIG. 5 is a schematic diagram of a hard disk indicator of a server according to the present invention;
FIG. 6 is a block diagram of a server apparatus according to the present invention;
FIG. 7 is a flowchart illustrating the execution of a test script according to the present invention;
FIG. 8 is a schematic flow chart illustrating an automated testing method according to the present invention;
FIG. 9 is a block diagram of an electronic device according to the present invention.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "comprising" and "having," and any variations thereof, as referred to in embodiments of the present invention, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Referring to fig. 8, an automated testing method for a disk array according to the present invention includes:
t1, after the preparation work of the test hardware is completed, based on the pre-stored test script, generating an original file with a preset capacity and a first MD5 check code corresponding to the original file on the target equipment;
t2, selecting one disk from the N disks as a hot spare disk based on the test script, and establishing a disk array based on the unselected N-1 disks;
t3, repeatedly executing the following steps:
t4, formatting the disk array into a file system based on the test script;
t5, in the process of copying the original file to the file system, based on the test script, removing any disk in the disk array, and adding the hot spare disk into the disk array for reconstruction until the disk array reconstruction is completed and the original file is copied, so as to obtain a copied file and a second MD5 check code corresponding to the copied file;
t6, comparing the first MD5 check code with the second MD5 check code based on the test script to obtain a comparison result;
t7, when the comparison results are the same, determining the hot spare disk as the tested disk, reselecting one disk from the untested disks as the hot spare disk, and rebuilding the disk array; the non-measured magnetic disks are other magnetic disks except the measured magnetic disk in the N magnetic disks;
until reaching the circulation stop condition; wherein the cycle stop condition is: and each disk in the N disks is used as a hot spare disk to be tested to obtain all comparison results, or the comparison results are different in the testing process.
The automatic test method of the disk array is an automatic test script, simulates a real test scene after the server is online, and can provide a pressure test before the server of an IT personnel room is online, or a hard disk compatibility test of a hard disk manufacturer, or a board card compatibility test of the disk array manufacturer, and a soft firmware compatibility test of the disk array manufacturer.
Meanwhile, the method further comprises the following steps:
recording the copying initial time before copying the original file to the file system; wherein, the copy initial time is used for representing the time of starting the test of a single disk;
when the comparison results are the same, recording the copying ending time; the copying end time is used for representing the time of a single disk for completing the test;
determining the test period duration of the tested magnetic disk based on the copying initial time and the copying ending time;
and estimating the residual time required by the test based on the test cycle duration of the tested disk, and displaying the residual time required by the test on a target display screen.
In addition, the method further includes:
and when the comparison results are different, determining that the test results of the N disks are test failures.
And the method further comprises:
after the loop is stopped, if all the comparison results are the same, determining that the test results of the N disks are successful.
Finally, the method further comprises:
and displaying the test result by utilizing indicator lamps on the N disks based on a preset display mode.
The test hardware preparation work includes: performing communication connection on the N disks and a server for executing the test script, and installing a server operating system on the target equipment; the target device is a USB flash disk.
The disk array is a RAID5 disk array.
The invention also provides an automatic testing device of the disk array, which comprises:
the generating unit is used for generating an original file with a preset capacity and a first MD5 check code corresponding to the original file on the target equipment based on a pre-stored test script after the preparation work of the test hardware is finished;
the selection establishing unit is used for selecting one disk from the N disks to serve as a hot standby disk based on the test script and establishing a disk array based on the unselected N-1 disks;
a test unit for performing the following steps until a cycle stop condition is reached; wherein the cycle stop conditions are as follows: each disk in the N disks is used as a hot spare disk to be tested or the comparison result is different:
formatting the disk array into a file system based on the test script;
in the process of copying the original file to the file system, based on the test script, removing any disk in the disk array, adding the hot spare disk into the disk array for reconstruction until the disk array reconstruction is completed and the original file is copied, and obtaining a copied file and a second MD5 check code corresponding to the copied file;
comparing the first MD5 check code with the second MD5 check code based on the test script to obtain a comparison result;
when the comparison results are the same, determining the hot spare disk as the tested disk, reselecting one disk from the untested disks as the hot spare disk, and reestablishing the disk array; the untested magnetic disk is the other magnetic disk except the tested magnetic disk in the N magnetic disks.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings or the orientations or positional relationships that the products of the present invention are conventionally placed in use, but are only used for convenience in describing the present invention and simplifying the description, and do not indicate or imply that the devices or components that are referred to must have specific orientations, be constructed and operated in specific orientations, and thus, should not be construed as limiting the present invention. Furthermore, the terms "first," "second," "third," and the like are used solely to distinguish one from another and are not to be construed as indicating or implying relative importance.
In the description of the present invention, it should also be noted that, unless otherwise explicitly specified or limited, the terms "disposed," "mounted," "connected," and "connected" are to be construed broadly and may, for example, be fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; the two components can be directly connected or indirectly connected through an intermediate medium, and the two components can be communicated with each other. The specific meanings of the above terms in the present invention can be understood in specific cases to those skilled in the art.
In addition, please refer to fig. 1, which is a schematic overall flow chart of a method for automatically testing a disk array and a hard disk for a multi-hard disk server according to the present invention, including the following steps:
s101, for the preparation of the testing environment,
s102, installing the operating system to the USB flash disk (/ dev/sda), herein take Linux as an example
S103, generating a 100GB file in the USB flash disk by the instruction,
s104, recording the MD5 check code of 100GB file,
s105, establishing a disk array of the hard disks RAID5 with code numbers 1 to (N-1),
s106, setting a hot standby hard disk,
s107, formatting the disk array into a usable file system,
s108, recording the current system time,
s109, copying the file of the USB flash disk 100G to the disk array,
s110, after 5 minutes, in the continuous process of copying the file, the script will instruct to remove the hard disk of the 1 st disk array,
s111, the RAID disk will automatically add a hot spare hard disk and rebuild the rebuild,
s112, while the file copy continues, the disk array rebuilds the rebuild at the same time,
s113, until the file copying is completed, the disk array rebuild is completed, the MD5 check code of the file is compared,
s114, recording the current system time, subtracting the system time recorded in S108 to obtain the time spent by the first cycle,
s115, returning to S105, the script builds a disk array with a second group of hard disks, sets another different hard disk as a hot spare until all hard disks have been executed with overheat removal and hot spare, completes all cycles,
and S116, all the cycle test ending scripts instruct all the hard disk state lamps, and if all the cycles test ending passes, all the hard disk state lamps (usually blue lamps or green lamps) are instructed to be turned off for 3 seconds for 1 second without interruption, so that the tester is prompted to test successfully.
Please refer to fig. 2, which is a schematic structural diagram of the present invention, the method includes:
the preparation unit 201, i.e. the preparation of the assembly server and hard disk, installation operation system, all hardware and software
The test unit 202 executes the script for the automated hard disk and disk array test of the present invention,
a copy unit 203 for copying the large-capacity file from the USB flash disk to the disk array,
a verification unit 204 for verifying whether the check codes of the copied original file and the copied file are the same,
the calculation unit 205 calculates the time required for the residue test,
the prompt unit 206 prompts the operator through the hard disk light signal if the test result passes.
Referring to fig. 3, a schematic diagram of a conventional manual testing process according to the present invention is shown, which is a method before the automatic testing is not introduced,
s301, for the preparation of the test environment,
s302, in order to install the operating system to the USB flash disk,
s303, generating a 100GB file in the USB flash disk by the instruction,
s304, recording the MD5 check code of 100GB file,
s305, establishing a RAID5 disk array,
s306, setting a hot standby hard disk,
s307, formatting the disk array as a usable file system,
s308, copying the file of the USB flash disk 100G to the disk array,
s309, in the process of copying the file continuously, manually pulling out the hard disks of 1 disk array,
s310, the RAID disk will automatically add a hot spare hard disk and rebuild the rebuild,
s311, while the file copy continues, the disk array rebuilds the rebuild at the same time,
s312, until the file copying is completed, the disk array rebuild is completed, the MD5 check code of the file is compared,
s313, returning to S305, a disk array is built with a second group of hard disks, a different hard disk is set as a hot spare until all hard disks have been subjected to the overheat removal and the hot spare,
s314, it means that the tester must look at the screen to know the progress and the test result, which is the most traditional manual testing method.
Please refer to fig. 4, which is an application environment diagram of a server under test according to the present invention, 401 is a screen keyboard device for an operator to use, and is connected to 402 the server under test, where 12 servers have been installed, 403 is a first test cycle, and 1 to 11 hard disks are used to establish a disk array, 404 is set as a hot spare hard disk, and when a file is copied, the first hard disk is extracted 405 to reduce the disk array, and the hot spare hard disk is automatically added 404 to reconstruct the disk array.
Please refer to fig. 5, which is a schematic diagram of a hard disk indicator of a server according to the present invention, wherein 501 is a tray rack of a hard disk of the server, two indicator lights are provided, the source of the two indicator lights is a hard disk back plate of the server, a light signal is transmitted through a light guide rod, 502 is a status light of the hard disk, 503 is an indicating movable light of the hard disk, in a working mode of the server, the status light is usually default that a fault of the hard disk will display red, the indicating movable light is usually default that the status light is green and normally on as long as the status light is online, and the status light is green and flashing as long as there is reading and writing, and the two light signal modes can be controlled through instructions.
Please refer to fig. 6, which is a structural diagram of a server device according to the present invention, wherein 601 is a server body, 602 is 12 installed hard disks, which are connected 603 to a hard disk backplane, and a backplane is connected 604 to a hard disk expander (expander).
Please refer to fig. 7, which is a flowchart illustrating the execution of the test script according to the present invention, including the following steps:
s701, in order to execute the automated test script,
s702, a 100GB file is generated in the U disk by an instruction, the file is 'fallocoate-l 100G/root/file.tst',
s703, record the MD5 check code, "MD 5sum file.tst >/root/md5. txt" of 100GB file,
s704, establishing a RAID5 disk array, taking 12 hard disks of the system as examples, namely "mdam- -create- -boot/dev/md 0- -level ═ 5- -RAID-devices ═ 11/dev/sdb/dev/scdc/dev/sdd/dev/sde/dev/sdf/dev/sdg/dev/sdh/dev/sdi/dev/sdj/dev/sdk/dev/sdl- -space-devices ═ dev/sdm",
s705, setting a hot spare hard disk, i.e. the parameter "— spare-devices" —/dev/sdm "of S105,
s706, format the disk array into a usable file system, here EXT4 is taken as example "mkfs. ext4/dev/md 0",
s707, record the current system time, "date +% S",
s708, copying the file of the USB flash disk 100G to the disk array,
s709, after 5 minutes, during the file copying process, the script instructs to remove the hard disk of the 1 st disk array, "mddm/dev/md 0- -fail/dev/sdb"
S710, the RAID disk will automatically add a hot spare hard disk and rebuild the rebuild,
s711, while the file replication continues, the disk array is simultaneously rebuilding the rebuild,
s712, until the file is copied and the rebuild of the disk array is completed, comparing the MD5 check code of the file,
s713, if the step S711 or S712 fails, the screen display test fails, and the script lights all the hard disk lamp status lamps
(usually red or amber)
“sg_ses--index=<HDD index>--set=fault/dev/sgx”
S714, recording the current system time, subtracting the system time recorded in S108 to obtain the time spent by the first cycle,
end=`date+%s`
runtime=$((end-start))
estimating the testing time needed by the remaining cycle (N-1) by the time T spent by the first cycle, namely T (N-1); when the script finishes the time T2 of the second cycle, the test time needed by the remaining cycle (N-2) is estimated, and the test time is averaged by the time of the first cycle and the second cycle and multiplied by the number of times of not finishing the cycle, namely [ (T + T2)/2 ]. times [ N-2 ]; when the script finishes the time T3 of the third cycle, the test time required by the rest cycles (N-3) is estimated, the average is the summation time of the first, the second and the third cycles, and the times of not finishing the cycles are multiplied, namely [ (T + T2+ T3)/3 ]. times [ N-3 ]; and so on …
For example:
the total system has 12 hard disks, the time spent on completing the first cycle is 2.5 hours, 11 cycles are needed to be performed, the time spent on displaying the screen is (2.5x11) hours, the time spent on completing the second cycle by the test script is 2.7 hours, 10 cycles are needed to be performed, the time spent on displaying the screen is [ (2.5+2.7)/2] 10 hours, the time spent on completing the third cycle by the test script is 2.6 hours, 9 cycles are needed to be performed, the time spent on displaying the screen is [ (2.5+2.7+2.6)/3] 9,
s715, returning to S704, the script establishes a disk array with a second group of hard disks, sets another different hard disk as a hot spare until all hard disks have been executed with overheat removal and hot spare, and completes all cycles
S716, all the cycle test ending scripts instruct all the hard disk state lamps to be started, if all the cycle tests are finished Pass, all the hard disk state lamps (usually blue lamps or green lamps) are instructed to be started for 3 seconds and stopped for 1 second without interruption, so that the tester is prompted to finish the test successfully,
“sg_ses--index=<HDD index>--set=ident/dev/sgx”
sleep 3
“sg_ses--index=<HDD index>--clear=ident/dev/sgx”
as shown in fig. 9, an electronic device 800 according to an embodiment of the present invention includes a memory 801 and a processor 802, where the memory stores a computer program that is executable on the processor, and the processor executes the computer program to implement the steps of the method according to the above embodiment.
As shown in fig. 9, the electronic apparatus further includes: a bus 803 and a communication interface 804, the processor 802, the communication interface 804, and the memory 801 being connected by the bus 803; the processor 802 is used to execute executable modules, such as computer programs, stored in the memory 801.
The Memory 801 may include a high-speed Random Access Memory (RAM), and may also include a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. The communication connection between the network element of the system and at least one other network element is realized through at least one communication interface 804 (which may be wired or wireless), and the internet, a wide area network, a local network, a metropolitan area network, and the like may be used.
The bus 803 may be an ISA bus, a PCI bus, an EISA bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 9, but this does not indicate only one bus or one type of bus.
The memory 801 is used for storing a program, the processor 802 executes the program after receiving an execution instruction, and the method performed by the apparatus defined by the process disclosed in any of the foregoing embodiments of the present invention may be applied to the processor 802, or implemented by the processor 802.
The processor 802 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by instructions in the form of hardware integrated logic circuits or software in the processor 802. The Processor 802 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, or discrete hardware components. The various methods, steps and logic blocks disclosed in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in the memory 801, and the processor 802 reads the information in the memory 801 and completes the steps of the method in combination with the hardware.
Corresponding to the method, the embodiment of the invention also provides a computer readable storage medium, wherein the computer readable storage medium stores machine executable instructions, and when the computer executable instructions are called and executed by a processor, the computer executable instructions cause the processor to execute the steps of the method.
The apparatus provided by the embodiment of the present invention may be specific hardware on the device, or software or firmware installed on the device, etc. The device provided by the embodiment of the present invention has the same implementation principle and technical effect as the method embodiments, and for the sake of brief description, reference may be made to the corresponding contents in the method embodiments without reference to the device embodiments. It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the foregoing systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
For another example, a division of elements into only one logical division may be implemented in a different manner, and multiple elements or components may be combined or integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed coupling or direct coupling or communication connection between each other may be through some communication interfaces, indirect coupling or communication connection between devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments provided by the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable magnetic disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus once an item is defined in one figure, it need not be further defined and explained in subsequent figures, and moreover, the terms "first", "second", "third", etc. are used merely to distinguish one description from another and are not to be construed as indicating or implying relative importance.
Finally, it should be noted that: although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art will understand that: those skilled in the art can still make modifications or changes to the embodiments described in the foregoing embodiments, or make equivalent substitutions for some features, within the scope of the disclosure; and the modifications, changes or substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention. Are intended to be covered by the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. An automated testing method for a disk array, comprising:
after the preparation work of the test hardware is finished, generating an original file with a preset capacity and a first MD5 check code corresponding to the original file on the target equipment based on a pre-stored test script;
selecting one disk from N disks as a hot spare disk based on the test script, and establishing a disk array based on the unselected N-1 disks;
repeatedly executing the following steps:
formatting the disk array into a file system based on the test script;
in the process of copying the original file to the file system, removing any disk in the disk array based on the test script, and adding the hot spare disk into the disk array for reconstruction until the disk array reconstruction is completed and the original file is copied, so as to obtain a copied file and a second MD5 check code corresponding to the copied file;
comparing the first MD5 check code with the second MD5 check code based on the test script to obtain a comparison result;
when the comparison results are the same, determining the hot spare disk as a tested disk, reselecting a disk from untested disks as the hot spare disk, and reestablishing a disk array; the untested magnetic disk is the other magnetic disk except the tested magnetic disk in the N magnetic disks;
until reaching the circulation stop condition; wherein the cycle stop condition is: and each disk in the N disks is used as a hot spare disk to be tested to obtain all comparison results, or the comparison results are different in the test process.
2. The method of claim 1, further comprising:
recording an initial copying time before copying the original archive to the archive system; wherein, the copy initial time is used for representing the time of starting the test of the single disk;
when the comparison results are the same, recording the copying ending time; wherein, the copying end time is used for representing the time when the single disk completes the test;
determining the test period duration of the tested disk based on the copying initial time and the copying finishing time;
and estimating the residual time required by the test based on the test cycle duration of the tested disk, and displaying the residual time required by the test on a target display screen.
3. The method of claim 1, further comprising:
and when the comparison results are different, determining that the test results of the N disks are test failures.
4. The method of claim 3, further comprising:
after the circulation stops, if all the comparison results are the same, determining that the test results of the N disks are successful.
5. The method of claim 4, further comprising:
and displaying the test result by utilizing the indicator lamps on the N disks based on a preset display mode.
6. The method of claim 1, wherein the test hardware preparation comprises: performing communication connection on the N disks and a server for executing the test script, and installing a server operating system on the target equipment; wherein, the target device is a USB flash disk.
7. The method of claim 1, wherein the disk array is a RAID5 disk array.
8. An automated test equipment for disk arrays, comprising:
the generating unit is used for generating an original file with a preset capacity and a first MD5 check code corresponding to the original file on target equipment based on a pre-stored test script after the preparation work of the test hardware is finished;
the selection establishing unit is used for selecting one disk from the N disks to serve as a hot standby disk based on the test script and establishing a disk array based on the unselected N-1 disks;
a test unit for performing the following steps until a cycle stop condition is reached; wherein the cycle stop condition is: each disk in the N disks is used as a hot spare disk to be tested or the comparison result is different:
formatting the disk array into a file system based on the test script;
in the process of copying the original file to the file system, removing any disk in the disk array based on the test script, and adding the hot spare disk into the disk array for reconstruction until the disk array reconstruction is completed and the original file is copied, so as to obtain a copied file and a second MD5 check code corresponding to the copied file;
comparing the first MD5 check code with the second MD5 check code based on the test script to obtain a comparison result;
when the comparison results are the same, determining the hot spare disk as a tested disk, reselecting a disk from untested disks as the hot spare disk, and reestablishing a disk array; and the untested magnetic disk is the other magnetic disk except the tested magnetic disk in the N magnetic disks.
9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program operable on the processor, and wherein the processor implements the steps of the method of any of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, carries out the steps of the method according to any one of claims 1-7.
CN202011188521.6A 2020-10-30 2020-10-30 Automatic testing method and device for disk array, electronic equipment and storage medium Active CN112463472B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011188521.6A CN112463472B (en) 2020-10-30 2020-10-30 Automatic testing method and device for disk array, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011188521.6A CN112463472B (en) 2020-10-30 2020-10-30 Automatic testing method and device for disk array, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112463472A CN112463472A (en) 2021-03-09
CN112463472B true CN112463472B (en) 2022-08-23

Family

ID=74834633

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011188521.6A Active CN112463472B (en) 2020-10-30 2020-10-30 Automatic testing method and device for disk array, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112463472B (en)

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW200519578A (en) * 2003-12-05 2005-06-16 Inventec Corp Automatic fault-tolerant method for image file realized in guiding process of Linux operating system
CN105700976A (en) * 2015-12-29 2016-06-22 浪潮(北京)电子信息产业有限公司 Detection method and apparatus for exception processing mechanism of diskette array system
CN110187841A (en) * 2019-05-30 2019-08-30 苏州浪潮智能科技有限公司 A kind of method, apparatus and storage server of system management memory disk

Also Published As

Publication number Publication date
CN112463472A (en) 2021-03-09

Similar Documents

Publication Publication Date Title
WO2021169260A1 (en) System board card power supply test method, apparatus and device, and storage medium
US5574855A (en) Method and apparatus for testing raid systems
CN111312325B (en) BBU fault diagnosis method and device, electronic equipment and storage medium
US6442709B1 (en) System and method for simulating disaster situations on peer to peer remote copy machines
EP2749848A1 (en) Firmware upgrade error detection and automatic rollback
CN112148542B (en) Reliability testing method, device and system for distributed storage cluster
CN110750396B (en) Server operating system compatibility testing method and device and storage medium
CN103364650A (en) Testing system and testing method
CN105260274A (en) Linux-based hard disk random hot plug stability detection method
CN110187841A (en) A kind of method, apparatus and storage server of system management memory disk
CN111273932B (en) Component refreshing method, system and computer readable storage medium
CN111240980A (en) Automatic regression testing method based on cloud pipe platform
CN104461791B (en) Information processing method and device
CN111048138A (en) Hard disk fault detection method and related device
CN114265733A (en) Automatic testing method and device for abnormal power failure of solid state disk
CN112463472B (en) Automatic testing method and device for disk array, electronic equipment and storage medium
CN109741786A (en) A kind of solid state hard disk monitoring method, device and equipment
US11609832B2 (en) System and method for hardware component connectivity verification
CN105700976A (en) Detection method and apparatus for exception processing mechanism of diskette array system
CN110674038A (en) Method and device for classifying error information in software test
CN114626053A (en) Testing method and device for national secret authentication, national secret authentication program and system
CN111857573A (en) Intelligent replacement method and system based on RAID (redundant array of independent disks) fault member disk
CN114328158A (en) Abnormity monitoring method and device, electronic equipment and storage medium
CN102023916A (en) Computer system detection method
CN113886165A (en) Verification method, device, equipment and readable medium for firmware diagnosis function

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant