CN109086226A - A kind of test macro, method, equipment and storage medium storing power down protection - Google Patents
A kind of test macro, method, equipment and storage medium storing power down protection Download PDFInfo
- Publication number
- CN109086226A CN109086226A CN201811108502.0A CN201811108502A CN109086226A CN 109086226 A CN109086226 A CN 109086226A CN 201811108502 A CN201811108502 A CN 201811108502A CN 109086226 A CN109086226 A CN 109086226A
- Authority
- CN
- China
- Prior art keywords
- storage
- power down
- measured
- module
- down protection
- 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.)
- Withdrawn
Links
- 238000003860 storage Methods 0.000 title claims abstract description 167
- 238000012360 testing method Methods 0.000 title claims abstract description 70
- 238000000034 method Methods 0.000 title claims description 41
- 238000012795 verification Methods 0.000 claims abstract description 63
- 238000010998 test method Methods 0.000 claims abstract description 8
- 230000008569 process Effects 0.000 claims description 29
- 238000012937 correction Methods 0.000 claims description 13
- 238000004590 computer program Methods 0.000 claims description 11
- 238000010008 shearing Methods 0.000 claims description 7
- 230000001681 protective effect Effects 0.000 claims 1
- 230000001276 controlling effect Effects 0.000 abstract 1
- 230000000875 corresponding effect Effects 0.000 abstract 1
- 230000006870 function Effects 0.000 description 5
- 230000000694 effects Effects 0.000 description 4
- 238000010586 diagram Methods 0.000 description 3
- 238000004519 manufacturing process Methods 0.000 description 3
- 238000013461 design Methods 0.000 description 2
- 230000006872 improvement Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000005096 rolling process Methods 0.000 description 2
- 241000208340 Araliaceae Species 0.000 description 1
- 235000005035 Panax pseudoginseng ssp. pseudoginseng Nutrition 0.000 description 1
- 235000003140 Panax quinquefolius Nutrition 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 230000002950 deficient Effects 0.000 description 1
- 235000013399 edible fruits Nutrition 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 235000008434 ginseng Nutrition 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
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/2273—Test methods
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/16—Protection against loss of memory contents
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Power Sources (AREA)
Abstract
The invention discloses a kind of test macros for storing power down protection, comprising: input module is used to obtain the target instruction target word for carrying volume mount directory, number parameter and size parameter;First carry module is used for storage formatting to be measured into file system, and by file system mounted to volume mount directory;Data generation module is for generating file destination;Shear module is used to shear file destination into volume mount directory;Energy supply control module is powered on for controlling storage power down to be measured in shear history, and in the first moment control later;Second carry module is used for file system mounted to volume mount directory;File verification module determines whether storage to be measured is verified by this power down protection for carrying out file verification, and according to check results.Using the solution of the present invention, the human input when carrying out storage power down protection test is reduced.The invention also discloses a kind of test method, equipment and storage mediums for storing power down protection, have corresponding effect.
Description
Technical field
The present invention relates to technical field of memory, more particularly to a kind of test macro, method, equipment for storing power down protection
And storage medium.
Background technique
Storage is the basis of IT industry, and the quality of storage performance is related to the safety of the steady fixed sum data of business.If hair
When raw uncontrollable power-off scene, power down protection can be carried out by BBU (Battery Backup Unit, backup power source group), that is, worked as
When the AC power supplies of storage disconnects, BBU can power automatically for it, to guarantee data cached rule, that is, ensure that data are not lost, no
Error, realizes safety, the consistency of data.
When storing production, whether the power-down protection for needing to verify the product be can be realized, that is, verify the production
The quality of product.In the prior art, by manually carrying out this test, since operating process is complex, and product number is stored
Amount is more, and the single product that stores may also need repeatedly to test to guarantee that test result is correct, so that carrying out storage power down protection
Test when, need a large amount of human inputs.
It is that current those skilled in the art are anxious in conclusion how to reduce human input when storage power down protection test
Technical problem to be solved.
Summary of the invention
The object of the present invention is to provide a kind of test macro, method, equipment and storage mediums for storing power down protection, with drop
Human input when low storage power down protection test.
In order to solve the above technical problems, the invention provides the following technical scheme:
A kind of test macro storing power down protection, comprising:
Input module, for obtaining the target instruction target word for carrying volume mount directory, number parameter and size parameter;
First carry module is used for after the input module obtains the target instruction target word, by storage formatting to be measured
At file system, and by the volume mount directory;
Data generation module, for generating file destination in local directory according to the target instruction target word;
Shear module, for shearing the file destination into the volume mount directory;
The energy supply control module, for controlling the storage power down to be measured in the shear history of the shear module,
And the first moment control storage to be measured after controlling power down powers on;
Second carry module, for the energy supply control module control it is described it is to be measured storage power on after, by the text
Part system carry is to the volume mount directory;
File verification module, the file destination for being generated according to the data generation module and described first
File after moment in the local directory and the volume mount directory carries out file verification, and true according to check results
Whether the fixed storage to be measured is verified by this power down protection.
Preferably, the file verification module includes:
Number of files verifies submodule, for after first moment, counts the local directory and described is wrapping with
The summation for carrying the quantity of documents of catalogue, judges whether the summation is equal to the number parameter, if it is, triggering file MD5
It is worth correction verification module, otherwise determines that the storage to be measured is not verified by this power down protection;
The file MD5 value correction verification module, for recording in the file destination before shear module triggering
First MD5 value of each subfile of preset quantity records the second of corresponding each subfile after first moment
MD5 value judges whether the first MD5 value is consistent with the 2nd MD5 value, if it is, determining that the storage to be measured passes through
Otherwise this time power down protection verification determines that the storage to be measured is not verified by this power down protection.
Preferably, further includes:
Quantity statistics module is tested, for determining that the storage to be measured passes through this in the file MD5 value correction verification module
After power down protection verification, whether judgement is more than or equal to preset frequency threshold value for the verification number of the storage to be measured, such as
Fruit is then to exit test process and determine that the test of the storage power down protection to be measured passes through, and otherwise triggers first carry
Module is verified with starting to execute power down protection next time.
Preferably, further includes:
Prompt information output module, for determining that the storage to be measured is not fallen by this in the file verification module
When electric protection verifies, prompt information is exported.
Preferably, log is also carried in the target instruction target word that the input module obtains to save contents;
The first carry module is also used to the operation process recording of itself in the log saves contents;
The shear module is also used to the operation process recording of itself in the log saves contents;
The energy supply control module is also used to the operation process recording of itself in the log saves contents;
The second carry module is also used to the operation process recording of itself in the log saves contents;
The file verification module is also used to the operation process recording of itself in the log saves contents.
A kind of test method storing power down protection, comprising:
Obtain the target instruction target word for carrying volume mount directory, number parameter and size parameter;
After obtaining the target instruction target word, by storage formatting to be measured at file system, and the file system is hung
It is loaded onto the volume mount directory;
File destination is generated in local directory according to the target instruction target word;
The file destination is sheared into the volume mount directory;
The storage power down to be measured is controlled in shear history, and the first moment control after controlling power down it is described to
Storage is surveyed to power on;
After the control storage to be measured powers on, by the volume mount directory;
According to the file destination and after first moment in the local directory and the volume mount directory
File, carry out file verification, and determine whether the storage to be measured is verified by this power down protection according to check results.
Preferably, the local directory according to the file destination and after first moment and described
The file in mount directory is rolled up, carries out file verification, and determine whether the storage to be measured is fallen by this according to check results
Electric protection verification, comprising:
It is described the file destination is sheared into the volume mount directory before, record pre- in the file destination
If the first MD5 value of each subfile of quantity;
After first moment, the total of the quantity of documents of the local directory and the volume mount directory is counted
With, and the 2nd MD5 value of corresponding each subfile is recorded,
Judge whether the summation is equal to the number parameter;
If it is not, then determining that the storage to be measured is not verified by this power down protection;
If it is, judge whether the first MD5 value consistent with the 2nd MD5 value, if it is, determine it is described to
It surveys storage to verify by this power down protection, otherwise determines that the storage to be measured is not verified by this power down protection.
Preferably, further includes:
After the determination storage to be measured is verified by this power down protection, judgement is for the storage to be measured
Whether verification number is more than or equal to preset frequency threshold value;
If it is, exiting test process and determining that the test of the storage power down protection to be measured passes through, institute is otherwise returned
It states storage formatting to be measured into file system, the step of by the volume mount directory, to start
Power down protection next time is executed to verify.
A kind of test equipment storing power down protection, comprising:
Memory, for storing computer program;
Processor, for executing the computer program to realize the content of any of the above-described.
A kind of computer readable storage medium is stored with computer program on the computer readable storage medium, described
The content of any of the above-described is realized when computer program is executed by processor.
Using technical solution provided by the embodiment of the present invention, comprising: input module is wrapping with load mesh for obtaining to carry
The target instruction target word of record, number parameter and size parameter;First carry module, for input module obtain target instruction target word it
Afterwards, by storage formatting to be measured at file system, and by file system mounted to volume mount directory;Data generation module is used for
File destination is generated in local directory according to target instruction target word;Shear module, for shearing file destination to volume mount directory
In;Energy supply control module, for controlling storage power down to be measured in the shear history of shear module, and after controlling power down
First moment control storage to be measured powers on;Second carry module, for energy supply control module control it is to be measured storage power on after,
By file system mounted to volume mount directory;File verification module, the file destination for being generated according to data generation module, with
And first local directory after the moment and the file in volume mount directory, file verification is carried out, and determine according to check results
Whether storage to be measured is verified by this power down protection.
In the scheme of the application, the test of storage power down protection can be carried out automatically.Specifically, it is only necessary to input module
Target instruction target word is inputted, subsequent associated process can carry out automatically, not need manual operation, therefore, the scheme of the application has
Reduce to effect the human input when carrying out storage power down protection test.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with
It obtains other drawings based on these drawings.
Fig. 1 is a kind of structural schematic diagram for the test macro for storing power down protection in the present invention;
Fig. 2 is a kind of implementation flow chart for the test method for storing power down protection in the present invention;
Fig. 3 is a kind of structural schematic diagram for the test equipment for storing power down protection in the present invention.
Specific embodiment
Core of the invention is to provide a kind of test macro for storing power down protection, significantly reduces and is carrying out storing
Human input when electric protection is tested.
In order to enable those skilled in the art to better understand the solution of the present invention, with reference to the accompanying drawings and detailed description
The present invention is described in further detail.Obviously, described embodiments are only a part of the embodiments of the present invention, rather than
Whole embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art are not making creative work premise
Under every other embodiment obtained, shall fall within the protection scope of the present invention.
Referring to FIG. 1, Fig. 1 is a kind of structural schematic diagram for the test macro for storing power down protection, system in the present invention
It comprises the following modules:
Input module 10, for obtaining the target instruction target word for carrying volume mount directory, number parameter and size parameter.
Target instruction target word can be inputted by tester, such as tester inputs target instruction target word, visitor by client
Family end passes through Ethernet again and sends target instruction target word to test press machine.Certainly, target instruction target word is also possible to be preset in test pressure
In machine, after being triggered by tester, input module 10 can carry out the acquisition of target instruction target word automatically.And it needs
Bright, the modules of the test macro of the application can be set in test press machine, and each module can be based on
Shell realizes automation.It is of course also possible to choose other kinds of programming language according to actual needs, this is had no effect on
The implementation of invention.
Volume mount directory, number parameter and size parameter are at least carried in target instruction target word.Volume mount directory can make
The position that press machine determines storage to be measured, number parameter and size parameter must be tested and carry out target text in data generation module 30
It is used when the generation of part.
First carry module 20 is used for after input module 10 obtains target instruction target word, and storage formatting to be measured is written
Part system, and by file system mounted to volume mount directory.
First carry module 20 is connect with input module 10, and after input module 10 gets target instruction target word, first is hung
Carrying module 20 can be by storage formatting to be measured at file system, and extremely rolls up mount directory for file system mounted.Specifically,
First carry module 20 can cooperate (SuSE) Linux OS multipath tool multipath, obtain to be measured deposit by cut order
The volume quantity and device symbols to be measured of storage, then pass through make filesystem order for storage formatting to be measured into file system.
It formats after completing, the volume mount directory specified by mount order carry file system to tester, i.e. target instruction target word
The volume mount directory of middle carrying.
Data generation module 30, for generating file destination in local directory according to target instruction target word.
Data generation module 30 can generate target text according to the number parameter and size parameter carried in target instruction target word
Part.Specifically, the multiple subfiles of dd order Mass production, each Ziwen can be passed through in the local directory of test press machine
The size of part is equal to the size parameter in target instruction target word, and for example, size is 4k, and the total quantity of subfile is equal to target instruction target word
In number parameter.File destination is the general name of the subfile generated.
Shear module 40, for shearing file destination into volume mount directory.
Testing press machine can be connected by SAN (Storage Area Network, storage area network) and storage to be measured
It connects, i.e., shear module 40 can be sheared file destination into volume mount directory by SAN network.Certainly, in other embodiment party
In formula, test between press machine and storage to be measured and be also possible to other connection types, enable to shear module 40 with it is to be measured
Data interaction is carried out between storage, has no effect on implementation of the invention.
Energy supply control module 50 for controlling storage power down to be measured in the shear history of shear module 40, and is controlling
The first moment control storage to be measured after power down powers on.
Energy supply control module 50 starts in shear history, and specific starting time point can be set according to the actual situation
It is fixed, such as according to the size of file destination, the factors such as shear velocity carry out the design at starting time point.Such as in a kind of specific reality
It applies in mode, after shear module 40 starts, according to the statistics of experimental data, is finished within shear history about 10 seconds, then may be used
The 4th second triggering energy supply control module 50 to utilize relevant time set, after the starting of shear module 40.
After energy supply control module 50 triggers, storage power down to be measured can be controlled first.Specifically, energy supply control module 50 can
To send AC power supplies port off instruction to AC power supplies controller by Ethernet, AC power supplies controller can control storage to be measured
Whether AC power supply can be received.When AC power supplies controller receives AC power supplies port off instruction, to be measured deposit can be controlled
Power down is stored up, that is, controls storage to be measured and loses AC power supply.
When storage to be measured loses AC power supply, if storage qualified product to be measured, BBU will start, to guarantee
It is data cached not lose.Specifically, the data in storage to be measured can will be written from test press machine in BBU starting
It is saved, when the storage to be measured being waited to retrieve AC power supply, then by this partial data rule, to guarantee data cached not lose
It loses.
It at first moment of the energy supply control module 50 after controlling storage power down to be measured, controls storage to be measured and powers on, first
Moment can be set according to actual needs.Specifically, energy supply control module 50 can be controlled by Ethernet to AC power supplies
Device, which sends AC power supplies port on instruction, can control to be measured deposit when AC power supplies controller receives AC power supplies port on instruction
Storage powers on, that is, controls storage to be measured and obtain AC power supply.
Second carry module 60, for energy supply control module 50 control it is to be measured storage power on after, file system is hung
It is loaded onto volume mount directory.
Energy supply control module 50 control it is to be measured storage power on after, due to test press machine need to redefine to be measured deposit
The position of storage, therefore the second carry module 60 will start, by file system mounted to volume mount directory.Specifically, can pass through
The volume mount directory that mount order carry file system is carried into target instruction target word.
File verification module 70, file destination for being generated according to data generation module 30 and after the first moment
File in local directory and volume mount directory carries out file verification, and determines whether storage to be measured leads to according to check results
Cross the verification of this power down protection.
The file destination that data generation module 30 generates is namely before shearing manipulation, without the file for damaging, losing.
And after the first moment, since storage to be measured lives through the operation that power down powers on again, so if the power down protection of storage to be measured
Function is normal, then the general act of the file after the first moment in local directory and the file in volume mount directory, it will with
The file destination that data generation module 30 generates before this is consistent.Correspondingly, if the power-down protection of storage to be measured is unqualified,
There may be the case where loss of data, error, will also make the text in the file and volume mount directory in local directory
The general act of part and file destination are inconsistent.
And it is pointed out that when carrying out file verification, can be and select out partial document and verified, it can also be with
It is complete verification, and verifies content and can be quantity of documents, file full text etc., has no effect on implementation of the invention.Such as one
In kind of specific embodiment, judge after whether the quantity of the subfile in file destination was equal to for the first moment local directory and
The quantity of documents summation in mount directory is rolled up, if it is, check results are file destination and local directory after the first moment
And the general act in volume mount directory is consistent, otherwise check results are that the two is inconsistent.
File verification module 70 can determine whether storage to be measured is verified by this power down protection according to check results, and
And when storage to be measured is not verified by this power down protection, it usually can directly terminate test process, and determine that this to be measured is deposited
The power-down protection of storage is unqualified.And it is to be measured storage by this power down protection verify when, can be terminate test process simultaneously
Determine that the power-down protection of the storage to be measured is qualified, in another embodiment, is also possible to triggering test quantity statistics
Module, test quantity statistics module may determine that whether the verification number for storage to be measured is more than or equal to preset number threshold
Value determines falling for the storage to be measured if it is, exiting test process and determining that the test of storage power down protection to be measured passes through
Electric protection function is qualified, if verification number is less than preset frequency threshold value, can trigger the first carry module 20 to open
Begin to execute power down protection next time to verify.Due in this kind of embodiment, storage to be measured is only being verified by power down protection
Number reaches frequency threshold value, and test process can just terminate, and also can further reduce the fraction defective of storage product, reduce
Single tests the error of existing test result.
Using technical solution provided by the embodiment of the present invention, comprising: input module 10 is wrapping with load for obtaining to carry
The target instruction target word of catalogue, number parameter and size parameter;First carry module 20 refers to for obtaining target in input module 10
After order, by storage formatting to be measured at file system, and by file system mounted to volume mount directory;Data generation module
30, for generating file destination in local directory according to target instruction target word;Shear module 40, for shearing file destination to volume
In mount directory;Energy supply control module 50 for controlling storage power down to be measured in the shear history of shear module 40, and is being controlled
The first moment control storage to be measured after power down processed powers on;Second carry module 60, for being controlled in energy supply control module 50
After storage to be measured powers on, by file system mounted to volume mount directory;File verification module 70, for generating mould according to data
Block 30 generate file destination and after the first moment local directory and volume mount directory in file, carry out file school
It tests, and determines whether storage to be measured is verified by this power down protection according to check results.
In the scheme of the application, the test of storage power down protection can be carried out automatically.Specifically, it is only necessary to input module
10 input target instruction target words, subsequent associated process can carry out automatically, not need manual operation, therefore, the scheme of the application
Significantly reduce the human input when carrying out storage power down protection test.
In a kind of specific embodiment of the invention, file verification module 70 may include following submodule:
Number of files verifies submodule, for after the first moment, counting local directory and rolling up the file of mount directory
The summation of quantity, judges whether summation is equal to number parameter, if it is, triggering file MD5 value correction verification module, otherwise determination to
Storage is surveyed not verify by this power down protection;
File MD5 value correction verification module, for recording the preset quantity in file destination before the triggering of shear module 40
First MD5 value of each subfile, and after the first moment, record the 2nd MD5 value of corresponding each subfile, judgement
Whether the first MD5 value is consistent with the 2nd MD5 value, if it is, determining that storage to be measured is verified by this power down protection, otherwise really
Fixed storage to be measured is not verified by this power down protection.
MD5 value refers to determining based on MD5 (Message-Digest Algorithm 5, Message-Digest Algorithm 5)
Value.In this kind of embodiment, file verification is carried out from quantity of documents and two aspect of file content.Specifically, first
After moment, i.e., after the second carry module 60 is by the file system mounted mount directory to volume, number of files verifies submodule can
To count the summation of the quantity of documents of local directory and volume mount directory, judge whether summation is equal to number parameter, quantity ginseng
Quantity of documents in number i.e. file destination.If the summation is identical as number parameter, illustrates local directory and be wrapping with load
The summation of the quantity of documents of catalogue is consistent with the quantity of documents that file destination is included, then triggers MD5 value correction verification module, otherwise may be used
It is not verified by this power down protection with determination storage to be measured.
It should be pointed out that file MD5 value correction verification module is just recorded default in file destination before being sheared
First MD5 value of each subfile of quantity, and after number of files verification submodule triggering file MD5 value correction verification module, text
Part MD5 value correction verification module will record the 2nd MD5 value of corresponding each subfile.Corresponding each subfile described herein,
It refers to corresponding to each subfile being predetermined in file destination.For example, sharing No. 1 in file destination, No. 2 until 1000
Work song file.Before being sheared, 1 work song file, 3 work song files and the respective MD5 value of 4 work song files are recorded, i.e.,
First MD5 value includes the MD5 value of 3 subfiles altogether.Then when obtaining the 2nd MD5 value, and to obtain this 3 subfiles respective
MD5 value, as the 2nd MD5 value.Certainly, in the specific implementation, preset quantity can also be set to and the son in file destination
The quantity of file is identical, that is, the verification of MD5 value is carried out to file destination entirety.
File MD5 value correction verification module may determine that whether the first MD5 value is consistent with the 2nd MD5 value, described herein consistent,
Refer to each MD5 value corresponding to different subfiles for including in the first MD5 value, it is opposite with include in the 2nd MD5 value
That the MD5 value answered is identical.After determining unanimously, then it can determine that storage to be measured is verified by this power down protection, otherwise
Determine that storage to be measured is not verified by this power down protection.Certainly, in the embodiment for being provided with test quantity statistics module,
After file MD5 value correction verification module determines that storage to be measured is verified by this power down protection, test quantity statistics module can be with
Whether judgement is more than or equal to preset frequency threshold value for the verification number of storage to be measured, if it is, exiting test process simultaneously
It determines that the test of storage power down protection to be measured passes through, triggers the first carry module 20 otherwise to start to execute power down protection next time
Verification.
In a kind of specific embodiment of the invention, further includes:
Prompt information output module, for determining storage to be measured not by this power down protection in file verification module 70
When verification, prompt information is exported.
In this embodiment, in order to enable what the storage to be measured of tester's timely learning was not verified by power down protection
Information can be based on prompt information when file verification module 70 determines that storage to be measured is not verified by this power down protection
Output module exports prompt information, so that tester carries out respective handling in time, such as is immediately switched to next to be measured deposit
Storage.
In a specific embodiment, log is also carried in the target instruction target word that input module 10 obtains to save contents,
Correspondingly, the first carry module 20 when carrying out the operation of itself, can also protect the operation process recording of itself in the log
It deposits in catalogue, meanwhile, shear module 40, energy supply control module 50, the second carry module 60 and file verification module 70,
With by the operation process recording of itself in the log saves contents.Such embodiment, being conducive to tester can be with
When obtain log and save contents the test log of middle placement, storage power down protection can be fully understanded by also allowing for tester
Test process and history test record, while also contributing to the subsequent analysis for storage product.
Corresponding to the system above embodiment, the embodiment of the invention also provides a kind of test sides for storing power down protection
The test macro of method, the test method of storage power down protection described below and above-described storage power down protection can be mutually right
It should refer to.
It is shown in Figure 2, it is a kind of implementation flow chart for the test method for storing power down protection in the present invention, including following
Step:
Step S201: the target instruction target word for carrying volume mount directory, number parameter and size parameter is obtained.
Step S202: after obtaining target instruction target word, by storage formatting to be measured at file system, and file system is hung
It is loaded onto volume mount directory.
Step S203: file destination is generated in local directory according to target instruction target word.
Step S204: file destination is sheared into volume mount directory.
Step S205: controlling storage power down to be measured in shear history, and the first moment control after controlling power down
Storage to be measured powers on.
Step S206: after controlling storage to be measured and powering on, by file system mounted to volume mount directory.
Step S207: the file according to file destination and after the first moment in local directory and volume mount directory,
File verification is carried out, and determines whether storage to be measured is verified by this power down protection according to check results.
In a kind of specific embodiment of the invention, step S207 the following steps are included:
Before shearing file destination into volume mount directory, each Ziwen of the preset quantity in file destination is recorded
First MD5 value of part;
After the first moment, counts local directory and roll up the summation of the quantity of documents of mount directory, and record phase
2nd MD5 value of each subfile answered,
Judge whether summation is equal to number parameter;
If it is not, then determining that storage to be measured is not verified by this power down protection;
If it is, judging whether the first MD5 value is consistent with the 2nd MD5 value, if it is, determining that storage to be measured passes through this
Otherwise secondary power down protection verification determines that storage to be measured is not verified by this power down protection.
It is further comprising the steps of in a kind of specific embodiment of the invention:
Determine it is to be measured storage by this power down protection verify after, judgement for storage to be measured verification number whether
More than or equal to preset frequency threshold value;
If it is, exiting test process and determining that the test of storage power down protection to be measured passes through, otherwise returning will be to be measured
Storage formatting is protected at file system by file system mounted to the step of rolling up mount directory with starting to execute power down next time
Shield verification.
In a kind of specific embodiment of the invention, further includes:
When determining that storage to be measured is not verified by this power down protection in step S207, prompt information is exported.
Corresponding to above method and system embodiment, the embodiment of the invention also provides a kind of surveys for storing power down protection
Equipment and a kind of computer readable storage medium are tried, it can with the test macro and method of above-described storage power down protection
Correspond to each other reference.
It can be found in Fig. 3, the test equipment of the storage power down protection includes:
Memory 301, for storing computer program;
Processor 302 realizes the survey of the storage power down protection in any of the above-described embodiment for executing computer program
The content of test system.
It is stored with computer program on the computer readable storage medium, is realized when computer program is executed by processor
State the content of the test macro of the storage power down protection in any embodiment.Computer readable storage medium mentioned here includes
It is random access memory (RAM), memory, read-only memory (ROM), electrically programmable ROM, electrically erasable ROM, register, hard
Any other form of storage medium well known in disk, moveable magnetic disc, CD-ROM or technical field.
It should also be noted that, herein, relational terms such as first and second and the like are used merely to one
Entity or operation are distinguished with another entity or operation, without necessarily requiring or implying between these entities or operation
There are any actual relationship or orders.Moreover, the terms "include", "comprise" or its any other variant are intended to contain
Lid non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those
Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment
Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that
There is also other identical elements in process, method, article or equipment including element.
Professional further appreciates that, unit described in conjunction with the examples disclosed in the embodiments of the present disclosure
And algorithm steps, can be realized with electronic hardware, computer software, or a combination of the two, in order to clearly demonstrate hardware and
The interchangeability of software generally describes each exemplary composition and step according to function in the above description.These
Function is implemented in hardware or software actually, the specific application and design constraint depending on technical solution.Profession
Technical staff can use different methods to achieve the described function each specific application, but this realization is not answered
Think beyond the scope of this invention.It is used herein that a specific example illustrates the principle and implementation of the invention,
Technical solution of the present invention that the above embodiments are only used to help understand and its core concept.It should be pointed out that for this
For the those of ordinary skill of technical field, without departing from the principle of the present invention, the present invention can also be carried out several
Improvement and modification, these improvements and modifications also fall within the scope of protection of the claims of the present invention.
Claims (10)
1. a kind of test macro for storing power down protection characterized by comprising
Input module, for obtaining the target instruction target word for carrying volume mount directory, number parameter and size parameter;
First carry module is used for after the input module obtains the target instruction target word, and storage formatting to be measured is written
Part system, and by the volume mount directory;
Data generation module, for generating file destination in local directory according to the target instruction target word;
Shear module, for shearing the file destination into the volume mount directory;
The energy supply control module, for controlling the storage power down to be measured in the shear history of the shear module, and
The first moment control storage to be measured after control power down powers on;
Second carry module, for the energy supply control module control it is described it is to be measured storage power on after, by the file system
Carry unite to the volume mount directory;
File verification module, the file destination and first moment for being generated according to the data generation module
File in the local directory and the volume mount directory later carries out file verification, and determines institute according to check results
State whether storage to be measured is verified by this power down protection.
2. the test macro of storage power down protection according to claim 1, which is characterized in that the file verification module packet
It includes:
Number of files verifies submodule, for after first moment, counts the local directory and described is wrapping with load mesh
The summation of the quantity of documents of record, judges whether the summation is equal to the number parameter, if it is, triggering file MD5 value school
Module is tested, otherwise determines that the storage to be measured is not verified by this power down protection;
The file MD5 value correction verification module, it is default in the file destination for recording before shear module triggering
First MD5 value of each subfile of quantity records the 2nd MD5 of corresponding each subfile after first moment
Value, judges whether the first MD5 value is consistent with the 2nd MD5 value, if it is, determining that the storage to be measured passes through this
Otherwise power down protection verification determines that the storage to be measured is not verified by this power down protection.
3. the test macro of storage power down protection according to claim 2, which is characterized in that further include:
Quantity statistics module is tested, for determining that the storage to be measured passes through this power down in the file MD5 value correction verification module
After protective calibration, whether judgement is more than or equal to preset frequency threshold value for the verification number of the storage to be measured, if so,
Then exit test process and determine it is described it is to be measured storage power down protection test pass through, otherwise trigger the first carry module with
Start to execute power down protection next time to verify.
4. the test macro of storage power down protection according to claim 1, which is characterized in that further include:
Prompt information output module, for determining that the storage to be measured is not protected by this power down in the file verification module
When shield verification, prompt information is exported.
5. the test macro of storage power down protection according to any one of claims 1 to 4, which is characterized in that the input
Log is also carried in the target instruction target word that module obtains to save contents;
The first carry module is also used to the operation process recording of itself in the log saves contents;
The shear module is also used to the operation process recording of itself in the log saves contents;
The energy supply control module is also used to the operation process recording of itself in the log saves contents;
The second carry module is also used to the operation process recording of itself in the log saves contents;
The file verification module is also used to the operation process recording of itself in the log saves contents.
6. a kind of test method for storing power down protection characterized by comprising
Obtain the target instruction target word for carrying volume mount directory, number parameter and size parameter;
After obtaining the target instruction target word, by storage formatting to be measured at file system, and by it is described it is file system mounted extremely
The volume mount directory;
File destination is generated in local directory according to the target instruction target word;
The file destination is sheared into the volume mount directory;
The storage power down to be measured is controlled in shear history, and the first moment control after controlling power down is described to be measured deposits
Storage powers on;
After the control storage to be measured powers on, by the volume mount directory;
Text according to the file destination and after first moment in the local directory and the volume mount directory
Part carries out file verification, and determines whether the storage to be measured is verified by this power down protection according to check results.
7. the test method of storage power down protection according to claim 6, which is characterized in that described according to the target text
Part and the file after first moment in the local directory and the volume mount directory carry out file verification, and
Determine whether the storage to be measured is verified by this power down protection according to check results, comprising:
It is described the file destination is sheared into the volume mount directory before, record the present count in the file destination
First MD5 value of each subfile of amount;
After first moment, the summation of the quantity of documents of the local directory and the volume mount directory is counted, and
And the 2nd MD5 value of corresponding each subfile is recorded,
Judge whether the summation is equal to the number parameter;
If it is not, then determining that the storage to be measured is not verified by this power down protection;
If it is, judge whether the first MD5 value is consistent with the 2nd MD5 value, if it is, determining described to be measured deposit
Storage is verified by this power down protection, otherwise determines that the storage to be measured is not verified by this power down protection.
8. the test method of storage power down protection according to claim 7, which is characterized in that further include:
After the determination storage to be measured is verified by this power down protection, judgement is directed to the verification of the storage to be measured
Whether number is more than or equal to preset frequency threshold value;
If it is, the test for exiting test process and the determination storage power down protection to be measured passes through, described incite somebody to action otherwise is returned
Storage formatting to be measured is at file system, the step of by the volume mount directory, to start to execute
Power down protection verifies next time.
9. a kind of test equipment for storing power down protection characterized by comprising
Memory, for storing computer program;
Processor, for executing the computer program to realize the content such as any one of claim 1 to 5.
10. a kind of computer readable storage medium, which is characterized in that be stored with computer on the computer readable storage medium
Program realizes the content such as any one of claim 1 to 5 when the computer program is executed by processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811108502.0A CN109086226A (en) | 2018-09-21 | 2018-09-21 | A kind of test macro, method, equipment and storage medium storing power down protection |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811108502.0A CN109086226A (en) | 2018-09-21 | 2018-09-21 | A kind of test macro, method, equipment and storage medium storing power down protection |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109086226A true CN109086226A (en) | 2018-12-25 |
Family
ID=64842336
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811108502.0A Withdrawn CN109086226A (en) | 2018-09-21 | 2018-09-21 | A kind of test macro, method, equipment and storage medium storing power down protection |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109086226A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112710911A (en) * | 2020-11-27 | 2021-04-27 | 中汽研汽车检验中心(天津)有限公司 | Power-off storage testing device and method for automobile event data recording system |
CN112992260A (en) * | 2019-12-12 | 2021-06-18 | 中国电信股份有限公司 | Evaluation method and device for disk array cache data protection function |
CN113138653A (en) * | 2021-04-14 | 2021-07-20 | 福州富昌维控电子科技有限公司 | Power failure data protection method and terminal |
CN113626872A (en) * | 2021-10-11 | 2021-11-09 | 宁波集联软件科技有限公司 | Control method for integrity of preset resources in automobile memory chip module |
-
2018
- 2018-09-21 CN CN201811108502.0A patent/CN109086226A/en not_active Withdrawn
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112992260A (en) * | 2019-12-12 | 2021-06-18 | 中国电信股份有限公司 | Evaluation method and device for disk array cache data protection function |
CN112710911A (en) * | 2020-11-27 | 2021-04-27 | 中汽研汽车检验中心(天津)有限公司 | Power-off storage testing device and method for automobile event data recording system |
CN113138653A (en) * | 2021-04-14 | 2021-07-20 | 福州富昌维控电子科技有限公司 | Power failure data protection method and terminal |
CN113626872A (en) * | 2021-10-11 | 2021-11-09 | 宁波集联软件科技有限公司 | Control method for integrity of preset resources in automobile memory chip module |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109086226A (en) | A kind of test macro, method, equipment and storage medium storing power down protection | |
CN104932963B (en) | The method and device of management terminal | |
CN107239457A (en) | Data archiving method and device | |
CN109857999A (en) | A kind of document drafts store method, device, electronic equipment and storage medium | |
CN106886003A (en) | Batteries of electric automobile monitoring module Auto-Test System and method | |
CN107608828A (en) | Method, system, device and the storage medium that data center's power down recovers automatically | |
CN106482299B (en) | Unit system data backup device and method and air conditioning unit with device | |
FI114048B (en) | Method and apparatus for utilizing programmed meters to characterize accumulators | |
CN106503138A (en) | A kind of journal file processing method and processing device | |
US10760549B2 (en) | Method and system for configuring wind turbines | |
CN109213659A (en) | A kind of monitoring method, device and the storage medium of device memory state | |
CN107608841A (en) | Hard disk test document generating method, device, equipment and readable storage medium storing program for executing | |
CN111367584A (en) | Power supply adaptation method and device and computer readable storage medium | |
CN107450854A (en) | The determination method and system of maximum thread under a kind of expected rate | |
CN107368058A (en) | It is a kind of for the fault monitoring method of equipment, equipment and computer-readable medium | |
CN105022663B (en) | Power system monitoring and control system | |
CN110471769A (en) | A kind of method for managing resource and device of virtual machine | |
CN103837835A (en) | Method and device for detecting capacity decreasing degree of mobile device battery | |
CN106993147B (en) | A kind of video recording covering method, device and network hard disk video recorder | |
CN103245915A (en) | Excitation system on line monitoring method based on real time PMU data | |
CN109683097A (en) | A kind of BBU capacity method of calibration, device and relevant device | |
KR101888125B1 (en) | Method and Control Device for testing secondary cell battery using measurement sequence | |
CN108387776A (en) | A kind of method for early warning and device of intelligent electric meter | |
CN109992483A (en) | A kind of temperature monitoring method, device, equipment and readable storage medium storing program for executing | |
CN107491287B (en) | Instruction execution method and device |
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 | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20181225 |
|
WW01 | Invention patent application withdrawn after publication |