CN109460336A - A kind of method and system of batch validation hard disk DST function - Google Patents
A kind of method and system of batch validation hard disk DST function Download PDFInfo
- Publication number
- CN109460336A CN109460336A CN201811298846.2A CN201811298846A CN109460336A CN 109460336 A CN109460336 A CN 109460336A CN 201811298846 A CN201811298846 A CN 201811298846A CN 109460336 A CN109460336 A CN 109460336A
- Authority
- CN
- China
- Prior art keywords
- dst
- hard disk
- time
- functional verification
- record
- 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.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/22—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
- G06F11/26—Functional testing
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)
Abstract
The present invention discloses a kind of method and system of batch validation hard disk DST function, this method comprises: device configuration automatic test script;Automatic test script is executed, DST functional verification is carried out to the hard disk of equipment, records and exports the DST functional verification time started, recommend the deadline, recommend waiting time and actual finish time.The present invention realizes the automation of testing process, saves the testing time, and reduces the investment of a large amount of manpowers, and error caused by avoiding in manual operation improves the accuracy of testing efficiency and test result.
Description
Technical field
The present invention relates to hard disk function testing fields, and in particular to a kind of method of batch validation hard disk DST function and is
System.
Background technique
With the arrival of Internet era, the continuous development of cloud computing is digitized constantly universal, data and data
Storage has become more and more important.The loss of any data can all cause irreparable damage to government organs, business unit
It loses.Hard disk especially mechanical disk stores a kind of the most commonly used storage medium as data, and just whether storing data function
Often, Bad Track whether influences data storage very big.Often because disk causes loss of data there are bad track.
DST (Disk Self Test) is an included critical function of mechanical disk, and the self-test for disk is checked oneself, and carrys out detection magnetic
Disk whether there is bad track, if impact to the storage of data.
In to DST test verifying, if recommend to complete to be an important judgment criteria in the deadline in DST.Currently,
DST test verifying is completed generally by manual time-keeping, but manual time-keeping always has more or less time error, especially exists
It is time-consuming very long in Long DST test verifying, if holding bad time point, will lead to do not observe Long DST completion when
Between, cause the inaccuracy of test.
Summary of the invention
To solve the above problems, the present invention provides a kind of method and system of batch validation hard disk DST function, using automatic
Change the automatic Verification that test script realizes DST function, automatic monitoring record various time points had not only reduced artificial investment, but also energy
Accurate recording various time points improve testing efficiency and accuracy.
The technical scheme is that a kind of method of batch validation hard disk DST function, comprising:
Device configuration automatic test script;
Automatic test script is executed, DST functional verification is carried out to the hard disk of equipment, records and exports DST functional verification
Time started recommends the deadline, recommends waiting time and actual finish time.
Further, the execution automatic test script carries out DST functional verification to the hard disk of equipment, records and defeated
DST functional verification time started, recommendation deadline, recommendation waiting time and actual finish time out, comprising:
The DST function type of verifying is selected, and executes automatic test script;
Carry out DST functional verification, record verifying time started;
DST functional verification is recorded to recommend the deadline and recommend the waiting time;
Record DST functional verification actual finish time;
Summarize and saves verification result.
Further, the progress DST functional verification, record verifying time started, comprising:
At the beginning of defining arrays for storing each hard disk DST functional verification;
Circulation realizes the batch validation of multiple hard disks, records the DST functional verification time started of each hard disk.
Further, the record DST functional verification is recommended the deadline and is recommended the waiting time, comprising:
Record of defining arrays recommends the deadline;
Record of defining arrays recommends the waiting time;
The batch validation of circulation time multiple hard disks, crawl DST functional verification are recommended the deadline and are recommended the waiting time,
The value of crawl is retained and exports preservation.
Further, the record DST functional verification actual finish time, comprising:
It searches and recommends the waiting time for longest hard disk, which is last disk as monitoring sequence in monitoring;
Continue to monitor each disk state;
It monitors and judges whether each hard disk DST functional verification is completed;
If completing, recording disk DST functional verification actual finish time;
It monitors and judges whether last block hard disk completes DST functional verification;
If completing, stop monitoring disk state;
The DST functional verification actual finish time of each hard disk is counted.
Further, saved verification result is saved by txt text.
Further, automatic test script is shell script.
The present invention also provides a kind of systems of batch validation hard disk DST function, comprising:
Type selects execution module: for selecting the DST function type of verifying, and executing automatic test script;
Time started logging modle: for carrying out DST functional verification, record verifying time started;
Recommend time recording module: recommending deadline and recommendation waiting time for recording DST functional verification;
Real time logging modle: for recording DST functional verification actual finish time;
As a result summarizing module: for summarizing verification result;
As a result preserving module: for saving verification result.
The method and system of batch validation hard disk DST function provided by the invention realize DST using automatic test script
The automatic Verification of function can run in the equipment that muti-piece hard disk configures, realize the automation of testing process, save test
Time, and the investment of a large amount of manpowers is reduced, error caused by avoiding in manual operation improves the standard of testing efficiency and test result
True property.In addition, this method is easy to operate, there is stronger ease for use, it is clear in structure between each module in system, it is convenient for safeguarding.
Detailed description of the invention
Fig. 1 is one method flow schematic diagram of embodiment.
Fig. 2 is the specific method flow diagram of step S2 in Fig. 1.
Specific embodiment
The present invention will be described in detail with reference to the accompanying drawing and by specific embodiment, and following embodiment is to the present invention
Explanation, and the invention is not limited to following implementation.
DST (Disk Self Test) i.e. disk self-checking function includes Short DST, that is, short self-test of disk and Long DST
That is disk totally self-checking, this two self-checking functions can be realized under linux system using smartctl order, and self-test is being executed
It can return and recommend the deadline after after order, it is 2min that general Short DST, which recommends the deadline, and explanation is completed within the time
The function is normal;Long DST is time-consuming general very long, as long as it is exactly normal for surveying Long DST function recommending to complete in the time
's.
The principle of this programme is: each test item in test being made into different function letters by automatic test script
Number, for recording various time points, automatic test script is realized the execution sequence of different function function or is realized and executes parallel,
Finally achievable one key of test assignment is distributed, hard disk DST functional verification backstage executes parallel, the record of DST time started, DST
The record, DST actual finish time record, test result of deadline is recommended to summarize.
Embodiment one
As shown in Figure 1, the present embodiment provides a kind of methods of batch validation hard disk DST function, comprising:
S1: device configuration automatic test script;
S2: executing automatic test script, carries out DST functional verification to the hard disk of equipment, records and export DST function and test
The time started is demonstrate,proved, recommends the deadline, recommend waiting time and actual finish time.
It should be noted that automatic test script can be shell script.Shell, which refers to, " to be provided user and uses boundary
The software in face ", similar to the command and later cmd.exe under DOS.It receives user command, then calls and answers accordingly
Use program.It is a kind of programming language again simultaneously.As command lanuage, its interactive life explained and execute user's input
Enable or automatically explain and execute pre-set a series of order;As programming language, it defines various
Variable and parameter, and provide many control structures just having in high-level language, including circulation and branch.
This method can verify the DST function of hard disk in the equipment that muti-piece hard disk configures, configuration muti-piece hard disk
Equipment can be server.
As shown in Fig. 2, step S2 executes automatic test script in the present embodiment, DST function is carried out to the hard disk of equipment
It is able to verify that, records and export the DST functional verification time started, recommend the deadline, recommend waiting time and actual finish time,
It is completed especially by following steps:
S201: the DST function type of verifying is selected, and executes automatic test script;
DST function type includes Short DST (short self-test) and Long DST (totally self-checking) two types, executes automation
When test script, determine to parametric variable.
S202: DST functional verification, record verifying time started are carried out;
At the beginning of being defined arrays first for storing each hard disk DST functional verification;Later, circulation is realized multiple hard
The batch validation of disk records the DST functional verification time started of each hard disk.
S203: record DST functional verification is recommended the deadline and is recommended the waiting time;
Equally, Yao Shouxian defines arrays record recommendation deadline and record recommendation waiting time of defining arrays, and then follows
The batch validation of ring time multiple hard disks, crawl DST functional verification recommends the deadline and recommends the waiting time, by the value of crawl
Retained and exports preservation.
It should be noted that the waiting time and deadline for completing verifying can be returned after executing DST functional verification, pass through
Return value is grabbed to realize.
S204: record DST functional verification actual finish time;
Short DST is typically all 2min, but every piece of disk of Long DST different deadlines can be variant, need herein by
It is last block disk of longest disk as monitoring sequence that DST, which recommends the waiting time,.
Therefore, which specifically includes:
S204-1: searching and recommend the waiting time for longest hard disk, which is last as monitoring sequence in monitoring
Disk;
S204-2: each disk state is continued to monitor;
S204-3: monitoring and judges whether each hard disk DST functional verification is completed;
S204-4: if completing, recording disk DST functional verification actual finish time;
S204-5: monitoring and judges whether last block hard disk completes DST functional verification;
S204-6: if completing, stop monitoring disk state;
S204-7: the DST functional verification actual finish time of each hard disk is counted.
It should be noted that can be by detecting disk state mark, to judge whether hard disk DST functional verification is completed, such as
When its Status Flag is 0, mark is completed.
S205: summarizing and saves verification result;
Summarize verification result by power function, is sequentially output drive, time started, recommends the deadline, recommend to wait
Time, actual finish time.
Saved verification result is saved by txt text.It should be noted that can surveyed after the completion of test execution
Examination executes the data monitored in interface display test, and test result can be stored under the current directory of script execution, such as
BeginTime.txt is for recording the DST time started;When RecomendTime.txt recommends the waiting time and completes for recording
Between;RealCT.txt is for recording the time for actually accomplishing DST.It is last only to retain three logs.
Embodiment two
Based on the above embodiment one, the present embodiment provides a kind of batch validation hard disk DST functions of realizing the above method
System.
The system includes:
Type selects execution module: for selecting the DST function type of verifying, and executing automatic test script;
Time started logging modle: for carrying out DST functional verification, record verifying time started;
Recommend time recording module: recommending deadline and recommendation waiting time for recording DST functional verification;
Real time logging modle: for recording DST functional verification actual finish time;
As a result summarizing module: for summarizing verification result;
As a result preserving module: for saving verification result.
It should be noted that time started logging modle, recommendation time recording module, real time record mould in the system
Block and result summarizing module are realized by each power function, clear in structure between each module, convenient for safeguarding.
To make those skilled in the art better understand the present invention program, this programme automatic test is elaborated below
Content for script, further to be explained to the present invention.
(1) correlated variables is inputted
This DST automatic test script only includes a parametric variable, i.e. the type of DST (DST_TYPE): Short or
Long。
Need to only order be inputted when execution: ./checkDST-v1.1.sh $ DST_TYPE.
(2) in script each function definition and explanation
1) execution and the record of time started of the StartDST () for DST
Wherein disklist is the drive list of the HD hard disk obtained by linux system order lsscsi
Disklist=`lsscsi | awk'{ print $ NF } ' | awk-F'/" { pri nt $ 3 } ' | sed 1d`
2) RecomendCT () recommends the record of deadline for DST.When can return to completion DST waiting after execution DST
Between and deadline point, realized by crawl DST return value.
3) MonitorCT () is for monitoring the time for actually accomplishing DST, and ShortDST is typically all 2min, but LongDST
Every piece of disk different deadlines can be variant, needs DST recommending the waiting time herein to be longest disk as monitoring sequence
Last block disk.
(3) result is checked
After the completion of test execution, the data that can be monitored in the test of test execution interface display, and test result can protect
There are under the current directory of script execution, have BeginTime.txt for recording the DST time started;RecomendTime.txt
Recommend waiting time and deadline for recording;RealCT.txt is for recording the time for actually accomplishing DST.Finally only need to protect
Stay three logs.
This programme is applicable to plurality of devices, easy to operate, clear in structure between each module with stronger ease for use,
It is convenient for safeguarding.The program can be realized the muti-piece HD automatic verifying DST of hard disk batch, not only reduce the investment of a large amount of manpowers, but also energy
Error caused by avoiding in manual operation, the accuracy for improving test result also improve the efficiency of test.
Disclosed above is only the preferred embodiment of the present invention, but the present invention is not limited to this, any this field
What technical staff can think does not have creative variation, and without departing from the principles of the present invention made by several improvement and
Retouching, should all be within the scope of the present invention.
Claims (8)
1. a kind of method of batch validation hard disk DST function characterized by comprising
Device configuration automatic test script;
Automatic test script is executed, DST functional verification is carried out to the hard disk of equipment, records and exports DST functional verification and start
Time recommends the deadline, recommends waiting time and actual finish time.
2. the method for batch validation hard disk DST function according to claim 1, which is characterized in that described to execute automation
Test script carries out DST functional verification to the hard disk of equipment, when recording and export the DST functional verification time started, recommending to complete
Between, recommend waiting time and actual finish time, comprising:
The DST function type of verifying is selected, and executes automatic test script;
Carry out DST functional verification, record verifying time started;
DST functional verification is recorded to recommend the deadline and recommend the waiting time;
Record DST functional verification actual finish time;
Summarize and saves verification result.
3. the method for batch validation hard disk DST function according to claim 2, which is characterized in that the progress DST function
Verifying, record verifying time started, comprising:
At the beginning of defining arrays for storing each hard disk DST functional verification;
Circulation realizes the batch validation of multiple hard disks, records the DST functional verification time started of each hard disk.
4. the method for batch validation hard disk DST function according to claim 2, which is characterized in that the record DST function
Verifying is recommended the deadline and is recommended the waiting time, comprising:
Record of defining arrays recommends the deadline;
Record of defining arrays recommends the waiting time;
The batch validation of circulation time multiple hard disks, crawl DST functional verification are recommended the deadline and are recommended the waiting time, will grab
The value taken is retained and exports preservation.
5. the method for batch validation hard disk DST function according to claim 2, which is characterized in that the record DST function
Verify actual finish time, comprising:
It searches and recommends the waiting time for longest hard disk, which is last disk as monitoring sequence in monitoring;
Continue to monitor each disk state;
It monitors and judges whether each hard disk DST functional verification is completed;
If completing, recording disk DST functional verification actual finish time;
It monitors and judges whether last block hard disk completes DST functional verification;
If completing, stop monitoring disk state;
The DST functional verification actual finish time of each hard disk is counted.
6. the method for batch validation hard disk DST function according to claim 2, which is characterized in that saved verification result
It is saved by txt text.
7. the method for batch validation hard disk DST function according to claim 1-6, which is characterized in that automation
Test script is shell script.
8. a kind of system of batch validation hard disk DST function characterized by comprising
Type selects execution module: for selecting the DST function type of verifying, and executing automatic test script;
Time started logging modle: for carrying out DST functional verification, record verifying time started;
Recommend time recording module: recommending deadline and recommendation waiting time for recording DST functional verification;
Real time logging modle: for recording DST functional verification actual finish time;
As a result summarizing module: for summarizing verification result;
As a result preserving module: for saving verification result.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811298846.2A CN109460336A (en) | 2018-11-02 | 2018-11-02 | A kind of method and system of batch validation hard disk DST function |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811298846.2A CN109460336A (en) | 2018-11-02 | 2018-11-02 | A kind of method and system of batch validation hard disk DST function |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109460336A true CN109460336A (en) | 2019-03-12 |
Family
ID=65609288
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811298846.2A Pending CN109460336A (en) | 2018-11-02 | 2018-11-02 | A kind of method and system of batch validation hard disk DST function |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109460336A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111274070A (en) * | 2019-11-04 | 2020-06-12 | 华为技术有限公司 | Hard disk detection method and device and electronic equipment |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101436422A (en) * | 2007-11-15 | 2009-05-20 | 英业达股份有限公司 | Method and system for hard disk dryrun |
CN102521092A (en) * | 2011-12-31 | 2012-06-27 | 曙光信息产业股份有限公司 | Hard disk test method and device |
CN103744759A (en) * | 2013-12-27 | 2014-04-23 | 浪潮电子信息产业股份有限公司 | Method for verifying unattended disk performance and stability under Linux system |
CN107145412A (en) * | 2017-04-18 | 2017-09-08 | 曙光信息产业(北京)有限公司 | The detection method and detection means of a kind of disk state |
-
2018
- 2018-11-02 CN CN201811298846.2A patent/CN109460336A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101436422A (en) * | 2007-11-15 | 2009-05-20 | 英业达股份有限公司 | Method and system for hard disk dryrun |
CN102521092A (en) * | 2011-12-31 | 2012-06-27 | 曙光信息产业股份有限公司 | Hard disk test method and device |
CN103744759A (en) * | 2013-12-27 | 2014-04-23 | 浪潮电子信息产业股份有限公司 | Method for verifying unattended disk performance and stability under Linux system |
CN107145412A (en) * | 2017-04-18 | 2017-09-08 | 曙光信息产业(北京)有限公司 | The detection method and detection means of a kind of disk state |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111274070A (en) * | 2019-11-04 | 2020-06-12 | 华为技术有限公司 | Hard disk detection method and device and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10055338B2 (en) | Completing functional testing | |
CN111756575B (en) | Performance analysis method and device of storage server and electronic equipment | |
CN104317712A (en) | Linux-based storage server fatigue testing method | |
CN110008129B (en) | Reliability test method, device and equipment for storage timing snapshot | |
CN108885724A (en) | Information processing unit, information processing method and message handling program | |
CN107329914A (en) | It is a kind of that the out of order method and device of hard disk is detected based on linux system | |
CN106649020A (en) | Detecting method and device for storage case burn information | |
CN109783509A (en) | SQL scenario generation method and device | |
CN109684149A (en) | A kind of hardware information monitoring method, device and the equipment of NVMe hard disk | |
CN111767162B (en) | Fault prediction method for hard disks of different models and electronic device | |
CN108897765A (en) | A kind of batch data introduction method and its system | |
CN111078510B (en) | Task processing progress recording method and device | |
CN106649018A (en) | Testing method of stability of storage system with expansion cabinet | |
CN109460336A (en) | A kind of method and system of batch validation hard disk DST function | |
CN106484618B (en) | A kind of parallel playback method and device based on memory access dependence pair | |
CN109857583A (en) | A kind of processing method and processing device | |
CN114676061A (en) | Knowledge graph-based automatic firmware detection method | |
CA3048699C (en) | Join pattern agnostic aggregate computation in database query operations | |
CN114116503A (en) | Test method, test device, electronic equipment and storage medium | |
CN110309054B (en) | Code validity testing method, computing device and storage medium | |
US10452273B2 (en) | Preemptive event-based data migration | |
CN101727369B (en) | Method for automatically verifying environment variable settings | |
CN113501034B (en) | Test log generation method and device for railway signal system | |
US11874764B2 (en) | Method and system for guaranteeing game quality by using artificial intelligence agent | |
CN106293897B (en) | Automatic scheduling system of subassembly |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190312 |
|
RJ01 | Rejection of invention patent application after publication |