CN115458031A - Hard disk test method and device, computer equipment and storage medium - Google Patents

Hard disk test method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN115458031A
CN115458031A CN202211000109.6A CN202211000109A CN115458031A CN 115458031 A CN115458031 A CN 115458031A CN 202211000109 A CN202211000109 A CN 202211000109A CN 115458031 A CN115458031 A CN 115458031A
Authority
CN
China
Prior art keywords
asynchronous event
hard disk
asynchronous
information
acquiring
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
Application number
CN202211000109.6A
Other languages
Chinese (zh)
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 CN202211000109.6A priority Critical patent/CN115458031A/en
Publication of CN115458031A publication Critical patent/CN115458031A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C29/00Checking stores for correct operation ; Subsequent repair; Testing stores during standby or offline operation
    • G11C29/56External testing equipment for static stores, e.g. automatic test equipment [ATE]; Interfaces therefor
    • 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)

Abstract

The application relates to a hard disk test method, a hard disk test device, computer equipment and a storage medium. The method comprises the following steps: configuring an error injection interface for hard disk test so that an asynchronous event is input into a hard disk through the error injection interface; acquiring and responding to a modification instruction, modifying and compiling the interface specification to obtain a modified interface specification; and acquiring and responding to a test instruction, and executing the asynchronous event through the modified interface specification to acquire the type information of the asynchronous event. By adopting the method, the accuracy and the efficiency of hard disk testing can be improved.

Description

Hard disk test method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of computer device technologies, and in particular, to a hard disk test method and apparatus, a computer device, and a storage medium.
Background
In the current hard disk test scheme, after a hard disk is powered on, a request of an asynchronous event is sent to the hard disk, so as to monitor the state of the hard disk through a processing flow of the asynchronous event, wherein when the asynchronous event is generated, a corresponding asynchronous event request can be output through a serial port, and a serial port log is obtained.
However, some disadvantages still exist in the current test scheme, for example, the current test scheme can only find whether an asynchronous event is generated by outputting an asynchronous event request, but cannot detect the type of the asynchronous event, and the test depth is not enough; in addition, the process of performing comparative analysis on the serial port log is also very complicated, and if the test faces asynchronous events in various scenes, the test process is more complicated, so that the hard disk test efficiency is low.
Disclosure of Invention
Therefore, the hard disk testing method, the hard disk testing device, the computer equipment and the storage medium are provided, and the problem that the hard disk testing efficiency is low in the prior art is solved.
In one aspect, a hard disk test method is provided, and the method includes:
configuring an error injection interface for hard disk test so as to input asynchronous events into a hard disk through the error injection interface;
acquiring and responding to a modification instruction, modifying and compiling the interface specification to obtain a modified interface specification;
and acquiring and responding to a test instruction, and executing the asynchronous event through the modified interface specification to acquire the type information of the asynchronous event.
In one embodiment, the method further comprises the following steps:
and searching function information corresponding to the asynchronous event in the interface specification, and adding a detection command of the asynchronous event to the function information according to the modification instruction so as to obtain the type information of the asynchronous event and output the type information when the asynchronous event is detected by the detection command.
In one embodiment, the method further comprises the following steps:
obtaining kernel buffer information, and comparing the kernel buffer information with a currently executed asynchronous event;
and if the kernel buffer information is consistent with the currently executed asynchronous event, obtaining the type information.
In one embodiment, the method further comprises the following steps:
acquiring a setting instruction, starting a detection switch of the asynchronous event according to the setting instruction, and clearing the kernel buffer information;
and acquiring and responding to the test instruction, executing the asynchronous event through the modified interface specification, and acquiring the current kernel buffer information.
In one embodiment, the method further comprises the following steps:
classifying the asynchronous events according to the type information of the asynchronous events, and encapsulating the classified asynchronous events in a command line interface;
and setting corresponding parameters according to the type information of the asynchronous event so as to execute the corresponding asynchronous event according to the parameters.
In one embodiment, the method further comprises the following steps:
detecting whether the asynchronous event is contained in the kernel buffer information;
if so, comparing the kernel buffer information with the type information of the currently executed asynchronous event;
and if the kernel buffer information is consistent with the type information of the currently triggered asynchronous event, outputting the kernel buffer information.
In one embodiment, the method further comprises the following steps:
and resetting the current test environment, and traversing and executing the asynchronous event according to the type information of the asynchronous event.
In another aspect, an apparatus for testing a hard disk is provided, the apparatus including:
the configuration module is used for configuring an error injection interface for hard disk testing so that an asynchronous event is input into a hard disk through the error injection interface;
the modification compiling module is used for acquiring and responding to the modification instruction, modifying and compiling the interface specification and acquiring the modified interface specification;
and the test module is used for acquiring and responding to a test instruction, executing the asynchronous event through the modified interface specification and acquiring the type information of the asynchronous event.
In another aspect, a computer device is provided, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and the processor implements the following steps when executing the computer program:
configuring an error injection interface for hard disk test so that an asynchronous event is input into a hard disk through the error injection interface;
acquiring and responding to a modification instruction, modifying and compiling the interface specification to obtain a modified interface specification;
and acquiring and responding to a test instruction, and executing the asynchronous event through the modified interface specification to acquire the type information of the asynchronous event.
In yet another aspect, a computer-readable storage medium is provided, on which a computer program is stored which, when executed by a processor, performs the steps of:
configuring an error injection interface for hard disk test so that an asynchronous event is input into a hard disk through the error injection interface;
acquiring and responding to a modification instruction, modifying and compiling the interface specification to obtain a modified interface specification;
and acquiring and responding to a test instruction, and executing the asynchronous event through the modified interface specification to acquire the type information of the asynchronous event.
According to the hard disk test method, the device, the computer equipment and the storage medium, the error injection interface for hard disk test is configured, so that asynchronous events are input into the hard disk through the error injection interface, and various types of asynchronous events can be triggered through the error injection interface; modifying and compiling the interface specification by acquiring and responding to the modification instruction to acquire the modified interface specification, so that the modified interface specification can acquire the related information of the asynchronous event; and acquiring and responding to a test instruction, executing the asynchronous event through the modified interface specification, acquiring the type information of the asynchronous event, and realizing the detection of the type of the asynchronous event. By the hard disk test method, the type of the asynchronous event can be detected, and the accuracy and efficiency of hard disk test are improved.
Drawings
FIG. 1 is a flow chart illustrating a hard disk test method according to an embodiment;
FIG. 2 is a block diagram of a hard disk test apparatus according to an embodiment;
FIG. 3 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
It should be noted that the drawings provided in this embodiment are only for schematically illustrating the basic idea of the present invention, and the components related to the present invention are only shown in the drawings and not drawn according to the number, shape and size of the components in actual implementation, and the form, quantity and proportion of each component in actual implementation may be arbitrarily changed, and the component layout may be more complicated. The structures, the proportions, the sizes, and the like shown in the drawings attached to the present specification are only used for matching with the disclosure of the present specification, so as to be understood and read by those skilled in the art, and are not used for limiting the conditions under which the present invention can be implemented, so that the present invention has no technical essence, and any structural modification, changes of the proportion relation, or adjustment of the size, should fall within the scope of the technical disclosure of the present invention without affecting the efficacy and the achievable purpose of the present invention. In addition, the terms "upper", "lower", "left", "right", "middle" and "one" used in the present specification are used for clarity of description, and are not intended to limit the scope of the present invention, and the relative relationship between the terms and the terms may be changed or adjusted without substantial change in the technical content.
In the process of testing the asynchronous event of the hard disk at present, a serial port is usually accessed to the hard disk, the running state of the hard disk is monitored, and after a new asynchronous event is triggered, the serial port can print and output the asynchronous event newly generated by the hard disk so as to judge that the asynchronous event is generated. However, the serial port can only acquire information about whether an asynchronous event occurs, the type of the asynchronous event cannot be detected, and checking and comparing the serial port log is a tedious work.
In an embodiment, as shown in fig. 1, a hard Disk testing method is provided, which is described by taking an example that the method is applied to an NVMe SSD (Non-Volatile Memory express Solid State Disk, a Solid State Disk of a Non-Volatile Memory host controller interface specification), and includes the following steps:
step 101, configuring an error injection interface for hard disk test, so that an asynchronous event is input into a hard disk through the error injection interface.
The Error injection interface refers to a program interface for injecting Error data and/or abnormal data, and the asynchronous Event comprises information of Error Event, SMART/Health Event, notice Event and the like.
Specifically, error injection can be performed through a uniform error injection interface, and various types of asynchronous events are encapsulated and injected into a hard disk.
And 102, acquiring and responding to the modification instruction, modifying and compiling the interface specification, and acquiring the modified interface specification.
The interface specification is a communication protocol, and in an application scenario taking NVMe SSD as an example, the interface specification refers to NVMe (Non-Volatile Memory host controller interface specification).
Specifically, after the modification instruction is obtained and responded, the core code of the corresponding NVMe interface specification is modified according to the modification instruction, the NVMe kernel driver code is compiled again, and a new kernel driver is loaded and generated.
And 103, acquiring and responding to a test instruction, executing the asynchronous event through the modified interface specification, and acquiring the type information of the asynchronous event.
Specifically, when the asynchronous event is executed through the modified NVMe code, the running information of the corresponding asynchronous event is generated in the cache, and the type information of the asynchronous event can be obtained from the running information.
In the hard disk test method, the error injection interface for hard disk test is configured, so that asynchronous events are input into the hard disk through the error injection interface, and various types of asynchronous events can be triggered through the error injection interface; modifying and compiling the interface specification by acquiring and responding to the modification instruction to acquire the modified interface specification, so that the modified interface specification can acquire the related information of the asynchronous event; and acquiring and responding to a test instruction, executing the asynchronous event through the modified interface specification, acquiring the type information of the asynchronous event, and realizing the detection of the type of the asynchronous event. By the hard disk test method, the type of the asynchronous event can be detected, and the accuracy and efficiency of hard disk test are improved.
In one embodiment, the method further comprises the following steps:
and searching function information corresponding to the asynchronous event in the interface specification, and adding a detection command of the asynchronous event to the function information according to the modification instruction so as to obtain the type information of the asynchronous event and output the type information when the asynchronous event is detected by the detection command.
Specifically, function code corresponding to the asynchronous event is found in a core code module defining NVMe, such as: and the nvme _ complete _ async _ event adds a capture code (namely, a detection command) of the asynchronous event in the function code of the asynchronous event for capturing the report of the asynchronous event and acquiring the type information of the asynchronous event in the report.
In one embodiment, the method further comprises the following steps:
acquiring kernel buffer information, and comparing the kernel buffer information with a currently executed asynchronous event;
and if the kernel buffer information is consistent with the currently executed asynchronous event, obtaining the type information.
The kernel buffer information comprises dmesg, wherein the dmesg is used for detecting and controlling kernel ring buffer, the startup information of the system can be known from the dmesg, the ring buffer information of the Linux kernel is displayed, and the output of the dmesg can be generally checked through a less or grep command, so that the information to be checked is easier to search.
Specifically, when the execution of the asynchronous event is triggered by the modified NVMe, corresponding buffer information should be acquired by the dmesg, the buffer information is compared with the currently triggered and executed asynchronous event, whether the information in the dmesg is consistent with the currently triggered asynchronous event is judged, if yes, the asynchronous event is successfully triggered, and the information in the dmesg contains and can reflect the type information of the asynchronous event.
In one embodiment, the method further comprises the following steps:
acquiring a setting instruction, starting a detection switch of the asynchronous event according to the setting instruction, and clearing the kernel buffer information;
and acquiring and responding to the test instruction, executing the asynchronous event through the modified interface specification, and acquiring the current kernel buffer information.
Specifically, taking the example of testing an asynchronous event of the "firmware activation" type, it is exemplarily illustrated that the switch for detecting the "firmware activation" asynchronous event may be opened by a set feature command, for example: nvme set-feature/dev/nvme0n1-f0xb-v 0x200; the previous dmesg information is again emptied to ensure that information of the newly triggered asynchronous event is recorded in the dmesg.
And then triggering and executing a firmware activation asynchronous event through the modified NVMe code, for example: nvme inject-async-t 2-i 1, wherein, t represents the type of the asynchronous event, and i represents the specific event information of the asynchronous event, namely, the relevant information of the corresponding asynchronous event when the execution is triggered can be obtained by detecting the buffering information of the dmesg kernel.
In one embodiment, the method further comprises the following steps:
classifying the asynchronous events according to the type information of the asynchronous events, and encapsulating the classified asynchronous events in a command line interface;
and setting corresponding parameters according to the type information of the asynchronous event so as to execute the corresponding asynchronous event according to the parameters.
The Command Line Interface, referred to herein as a CLI (Command-Line Interface), also refers to a Command Line Interface that allows a user to type in text commands that instruct a computer to perform specific tasks.
Specifically, various asynchronous events can be classified and packaged in a CLI tool according to the type information of the asynchronous events, the type of the asynchronous events is represented by a parameter-t, and the specific event information of the asynchronous events is represented by a parameter-i, so that the error injection interface is obtained.
Illustratively, an Error Event may be correspondingly represented by a parameter-t 0, a SMART/Health Event may be correspondingly represented by a parameter-t 1, and a Notice Event may be represented by a parameter-t 2; the specific asynchronous Event information may be represented by a parameter-i, for example, a Notice Event asynchronous Event is taken as an example, the-i represents a specific Event of "firmware activation" in the Notice Event, and according to nvme entry-async-t 2-i 1, an asynchronous Event of "firmware activation" may be injected and triggered.
In one embodiment, the method further comprises the following steps:
detecting whether the asynchronous event is contained in the kernel buffer information;
if so, comparing the kernel buffer information with the type information of the currently executed asynchronous event;
and if the kernel buffer information is consistent with the type information of the currently triggered asynchronous event, outputting the kernel buffer information.
Illustratively, the kernel buffering information can be detected through a check _ dmesg function, which includes determining whether relevant information of an asynchronous event exists in the dmesg, comparing the generated relevant information about the asynchronous event in the dmesg with type information of the asynchronous event which is currently injected and triggers execution, determining whether the relevant information and the type information are consistent, testing whether an exception exists in the process from the injection of the asynchronous event to the output of the dmesg information of the hard disk, and under the condition that the asynchronous event is triggered, correspondingly operating conditions of the hard disk.
In one embodiment, the method further comprises the following steps:
and resetting the current test environment, and traversing and executing the asynchronous event according to the type information of the asynchronous event.
Specifically, after completing a test process and resetting the test environment, the hard disk test method in the above embodiment may be adopted, and according to the type information of the asynchronous event, traverse all types of asynchronous events and trigger execution to obtain corresponding kernel buffer information, so as to implement a comprehensive test on the hard disk.
It should be understood that, although the steps in the above-described flowcharts are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a portion of the steps in the flowchart may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the sub-steps or stages is not necessarily sequential, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
In one embodiment, as shown in fig. 2, there is provided a hard disk test apparatus including: a configuration module, a modification compilation module and a test module, wherein:
the configuration module is used for configuring an error injection interface for hard disk testing so that an asynchronous event is input into a hard disk through the error injection interface;
the modification compiling module is used for acquiring and responding to the modification instruction, modifying and compiling the interface specification and acquiring the modified interface specification;
and the test module is used for acquiring and responding to a test instruction, executing the asynchronous event through the modified interface specification and acquiring the type information of the asynchronous event.
In one embodiment, the method further comprises the following steps:
the modification compiling module is further configured to search function information corresponding to the asynchronous event in the interface specification, and add a detection command of the asynchronous event to the function information according to the modification instruction, so that when the detection command detects the asynchronous event, the type information of the asynchronous event is obtained and the type information is output.
In one embodiment, the method further comprises the following steps:
the comparison module is used for acquiring kernel buffer information and comparing the kernel buffer information with a currently executed asynchronous event;
and if the kernel buffer information is consistent with the currently executed asynchronous event, obtaining the type information.
In one embodiment, the method further comprises the following steps:
the setting module is used for acquiring a setting instruction, starting a detection switch of the asynchronous event according to the setting instruction and clearing the kernel buffer information;
and acquiring and responding to the test instruction, executing the asynchronous event through the modified interface specification, and acquiring the current kernel buffer information.
In one embodiment, the method further comprises the following steps:
the encapsulation module is used for classifying the asynchronous events according to the type information of the asynchronous events and encapsulating the classified asynchronous events in a command line interface;
and setting corresponding parameters according to the type information of the asynchronous event so as to execute the corresponding asynchronous event according to the parameters.
In one embodiment, the method further comprises the following steps:
the detection module is used for detecting whether the kernel buffer information contains the asynchronous event;
if so, comparing the kernel buffer information with the type information of the currently executed asynchronous event;
and if the kernel buffer information is consistent with the type information of the currently triggered asynchronous event, outputting the kernel buffer information.
In one embodiment, the method further comprises the following steps:
and the traversing module is used for resetting the current test environment, traversing and executing the asynchronous event according to the type information of the asynchronous event.
For the specific definition of the hard disk test device, reference may be made to the definition of the hard disk test method above, and details are not described herein again. All or part of each module in the hard disk test device can be realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent of a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 3. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a hard disk testing method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on a shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 3 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program:
configuring an error injection interface for hard disk test so that an asynchronous event is input into a hard disk through the error injection interface;
acquiring and responding to a modification instruction, modifying and compiling the interface specification to obtain a modified interface specification;
and acquiring and responding to a test instruction, and executing the asynchronous event through the modified interface specification to acquire the type information of the asynchronous event.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
and searching function information corresponding to the asynchronous event in the interface specification, and adding a detection command of the asynchronous event to the function information according to the modification instruction so as to obtain the type information of the asynchronous event and output the type information when the asynchronous event is detected by the detection command.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
acquiring kernel buffer information, and comparing the kernel buffer information with a currently executed asynchronous event;
and if the kernel buffer information is consistent with the currently executed asynchronous event, obtaining the type information.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
acquiring a setting instruction, starting a detection switch of the asynchronous event according to the setting instruction, and clearing the kernel buffer information;
and acquiring and responding to the test instruction, executing the asynchronous event through the modified interface specification, and acquiring the current kernel buffer information.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
classifying the asynchronous events according to the type information of the asynchronous events, and encapsulating the classified asynchronous events in a command line interface;
and setting corresponding parameters according to the type information of the asynchronous event so as to execute the corresponding asynchronous event according to the parameters.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
detecting whether the asynchronous event is contained in the kernel buffer information;
if so, comparing the kernel buffer information with the type information of the currently executed asynchronous event;
and if the kernel buffer information is consistent with the type information of the currently triggered asynchronous event, outputting the kernel buffer information.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
and resetting the current test environment, and traversing and executing the asynchronous event according to the type information of the asynchronous event.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
configuring an error injection interface for hard disk test so that an asynchronous event is input into a hard disk through the error injection interface;
acquiring and responding to a modification instruction, and modifying and compiling the interface specification to obtain a modified interface specification;
and acquiring and responding to a test instruction, and executing the asynchronous event through the modified interface specification to acquire the type information of the asynchronous event.
In one embodiment, the computer program when executed by the processor further performs the steps of:
and searching function information corresponding to the asynchronous event in the interface specification, and adding a detection command of the asynchronous event to the function information according to the modification instruction so as to obtain the type information of the asynchronous event and output the type information when the asynchronous event is detected by the detection command.
In one embodiment, the computer program when executed by the processor further performs the steps of:
acquiring kernel buffer information, and comparing the kernel buffer information with a currently executed asynchronous event;
and if the kernel buffer information is consistent with the currently executed asynchronous event, obtaining the type information.
In one embodiment, the computer program when executed by the processor further performs the steps of:
acquiring a setting instruction, starting a detection switch of the asynchronous event according to the setting instruction, and clearing the kernel buffer information;
and acquiring and responding to the test instruction, executing the asynchronous event through the modified interface specification, and acquiring the current kernel buffer information.
In one embodiment, the computer program when executed by the processor further performs the steps of:
classifying the asynchronous events according to the type information of the asynchronous events, and encapsulating the classified asynchronous events in a command line interface;
and setting corresponding parameters according to the type information of the asynchronous event so as to execute the corresponding asynchronous event according to the parameters.
In one embodiment, the computer program when executed by the processor further performs the steps of:
detecting whether the asynchronous event is contained in the kernel buffer information;
if so, comparing the kernel buffer information with the type information of the currently executed asynchronous event;
and if the kernel buffer information is consistent with the type information of the currently triggered asynchronous event, outputting the kernel buffer information.
In one embodiment, the computer program when executed by the processor further performs the steps of:
and resetting the current test environment, and traversing and executing the asynchronous event according to the type information of the asynchronous event.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), rambus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, and these are all within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A hard disk test method is characterized by comprising the following steps:
configuring an error injection interface for hard disk test so that an asynchronous event is input into a hard disk through the error injection interface;
acquiring and responding to a modification instruction, and modifying and compiling the interface specification to obtain a modified interface specification;
and acquiring and responding to a test instruction, and executing the asynchronous event through the modified interface specification to acquire the type information of the asynchronous event.
2. The hard disk test method of claim 1, wherein the modifying and compiling the interface specification comprises:
and searching function information corresponding to the asynchronous event in the interface specification, and adding a detection command of the asynchronous event to the function information according to the modification instruction so as to obtain the type information of the asynchronous event and output the type information when the asynchronous event is detected by the detection command.
3. The hard disk test method of claim 1, wherein the executing the asynchronous event through the modified interface specification further comprises:
acquiring kernel buffer information, and comparing the kernel buffer information with a currently executed asynchronous event;
and if the kernel buffer information is consistent with the currently executed asynchronous event, obtaining the type information.
4. The hard disk test method according to claim 3, wherein before the obtaining the kernel buffer information, the method further comprises:
acquiring a setting instruction, starting a detection switch of the asynchronous event according to the setting instruction, and clearing the kernel buffer information;
and acquiring and responding to the test instruction, executing the asynchronous event through the modified interface specification, and acquiring the current kernel buffer information.
5. The hard disk test method of claim 1, wherein the configuring the error injection interface for hard disk test comprises:
classifying the asynchronous events according to the type information of the asynchronous events, and encapsulating the classified asynchronous events in a command line interface;
and setting corresponding parameters according to the type information of the asynchronous events so as to execute the corresponding asynchronous events according to the parameters.
6. The hard disk test method of claim 3, wherein the comparing the kernel buffer information with the currently executed asynchronous event comprises:
detecting whether the asynchronous event is contained in the kernel buffer information;
if so, comparing the kernel buffer information with the type information of the currently executed asynchronous event;
and if the kernel buffer information is consistent with the type information of the currently triggered asynchronous event, outputting the kernel buffer information.
7. The hard disk test method according to claim 6, wherein the outputting the kernel buffer information further comprises:
and resetting the current test environment, and traversing and executing the asynchronous event according to the type information of the asynchronous event.
8. A hard disk test apparatus, the apparatus comprising:
the configuration module is used for configuring an error injection interface for hard disk testing so that an asynchronous event is input into a hard disk through the error injection interface;
the modification compiling module is used for acquiring and responding to the modification instruction, modifying and compiling the interface specification and acquiring the modified interface specification;
and the test module is used for acquiring and responding to a test instruction, executing the asynchronous event through the modified interface specification and acquiring the type information of the asynchronous event.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the hard disk testing method according to any of claims 1 to 7 are implemented by the processor when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the hard disk testing method according to any one of claims 1 to 7.
CN202211000109.6A 2022-08-19 2022-08-19 Hard disk test method and device, computer equipment and storage medium Pending CN115458031A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211000109.6A CN115458031A (en) 2022-08-19 2022-08-19 Hard disk test method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211000109.6A CN115458031A (en) 2022-08-19 2022-08-19 Hard disk test method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115458031A true CN115458031A (en) 2022-12-09

Family

ID=84298514

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211000109.6A Pending CN115458031A (en) 2022-08-19 2022-08-19 Hard disk test method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115458031A (en)

Similar Documents

Publication Publication Date Title
CN108595329B (en) Application testing method and device and computer storage medium
CN109408261B (en) Application program crash processing method and device, computer equipment and storage medium
CN110928777B (en) Test case processing method, device, equipment and storage medium
CN110162453B (en) Test method, test device, computer readable storage medium and computer equipment
CN111726818A (en) Wireless chip testing method and device, computer equipment and storage medium
CN112882769B (en) Skill pack data processing method, skill pack data processing device, computer equipment and storage medium
CN112650658A (en) Application program exception recording and reproduction method, device and storage medium
CN108241516B (en) Embedded system program loading method and device, computer equipment and storage medium
CN113099439A (en) OTA upgrade pressure test method, device, computer equipment and storage medium
CN113127329B (en) Script debugging method and device and computer storage medium
CN115292201B (en) Function call stack parsing and backtracking method and device
CN114328168A (en) Anomaly detection method and device, computer equipment and storage medium
CN115458031A (en) Hard disk test method and device, computer equipment and storage medium
CN111488288A (en) Method, device, terminal and storage medium for testing BMC ACD stability
CN114090434B (en) Code debugging method and device, computer equipment and storage medium
CN111176930B (en) Component operation data processing method and device, computer equipment and storage medium
CN110633210B (en) File execution method and device, storage medium and electronic equipment
CN111176653B (en) Program compiling and packaging method and device, electronic equipment and storage medium
CN113868127A (en) Online debugging method and device, computer equipment and storage medium
CN108549585B (en) Method for modifying application data, application testing method and device
CN114253825A (en) Memory leak detection method and device, computer equipment and storage medium
CN112527265A (en) Method for automatically injecting logs and computer equipment
CN111104327A (en) Solid state disk control software testing method, device and system and computer equipment
CN114266037B (en) Sample detection method and device, electronic equipment and storage medium
CN113377613B (en) Hard disk test monitoring method and device based on Windows system and computer equipment

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