Electronic equipment testing method and device

By introducing test agents and platform descriptors into storage devices, the problem of difference in feature understanding between testing software and storage device firmware is solved, accurate testing and acceptance standards are achieved, and the testing process is simplified.

CN110618903BActive Publication Date: 2024-12-10MEMBLAZE TECH BEIJING
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201810630006.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-06-19
Publication Date
2024-12-10
Estimated Expiration
2038-06-19

AI Technical Summary

Technical Problem

Testing software has difficulty understanding the characteristics of storage devices and setting correct acceptance criteria, resulting in test failures and failing to confirm storage device defects, especially when there are differences in understanding between testing software developed by different teams and storage device firmware.

Method used

By introducing test agents and platform descriptors into storage devices, the test agent receives test commands and obtains platform descriptors, generates and processes storage commands, ensuring that the characteristics between the test software and firmware are consistent, and the platform descriptors are updated to meet testing requirements. Ensure the effectiveness of the testing process.

Benefits of technology

The test software accurately understands the characteristics and firmware of the storage device by the test software, ensures the effectiveness of the test process, avoids test failures due to feature differences, and simplifies the testing process for different versions of firmware.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110618903B_ABST
    Figure CN110618903B_ABST
Patent Text Reader

Abstract

The present application relates to a storage device, and in particular to an electronic device testing method and apparatus, wherein the storage device includes: a storage interface, a test interface, a test agent, a platform descriptor, and firmware; the test agent receives a test command of the test device through the test interface, obtains a platform descriptor according to the test command, and provides the platform descriptor to the test device through the test interface; the firmware receives a storage command generated by the test device according to the platform descriptor through the storage interface, processes the storage command according to the platform descriptor to obtain a processing result, and provides the processing result to the test device through the storage interface. Since the same platform descriptor is used by both the firmware and the test agent, it ensures that the characteristics of the storage device known by the test software are consistent with the characteristics of the storage device provided by the firmware, thereby ensuring the effective conduct of the test process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of storage devices, and in particular to a testing method and apparatus for testing software or firmware running on a storage device. Background Art

[0002] See also Figure 1 , showing a block diagram of a storage device. The storage device 102 is coupled to the host to provide storage capabilities for the host. The host and the storage device 102 can be coupled in a variety of ways, including but not limited to connecting the host and the storage device 102 through, for example, SATA, IDE, USB, PCIE, NVMe (NVM Express), SAS, Ethernet, Fiber Channel, wireless communication network, etc. The host can be an information processing device that can communicate with the storage device in the above manner, such as a personal computer, a tablet computer, a server, a portable computer, a network switch, a router, a cellular phone, a personal digital assistant, etc. The storage device 102 includes an interface 103, a control component 104, one or more NVM (non-volatile memory) chips 105, and optionally a firmware memory 110. The interface 103 can be adapted to exchange data with the host through, for example, SATA, IDE, USB, PCIE, NVMe, SAS, Ethernet, Fiber Channel, etc. The control component 104 is used to control data transmission between the interface 103, the NVM chip 105 and the firmware memory 110, and is also used for storage management, host logical address to flash physical address mapping, erase leveling, bad block management, etc. The control component 104 can be implemented in a variety of ways such as software, hardware, firmware or a combination thereof. The control component 104 can be in the form of an FPGA (Field-programmable gate array), an ASIC (Application Specific Integrated Ci rcuit) or a combination thereof. The control component 104 can also include a processor or a controller. The control component 104 loads firmware from the firmware memory 110 at runtime. The firmware memory 110 can be a NOR flash memory, a ROM, an EEPROM, or a part of the NVM chip 105.

[0003] The control component 104 includes a flash memory interface controller (or medium interface controller, flash memory channel controller), which is coupled to the NVM chip 105 and issues commands to the NVM chip 105 in a manner that complies with the interface protocol of the NVM chip 105 to operate the NVM chip 105, and receives command execution results output from the NVM chip 105. Known NVM chip interface protocols include "Toggle", "ONFI" and the like.

[0004] A memory target is one or more logic units (LUNs) within a NAND flash memory package that share a chip enable (CE) signal. A NAND flash memory package may include one or more dies. Typically, a logic unit corresponds to a single die. A logic unit may include multiple planes. Multiple planes within a logic unit may be accessed in parallel, and multiple logic units within a NAND flash memory chip may execute commands and report status independently of each other. In "Open NAND Flash Interface Specification (Revision 3.0)" available from http: / / www.micron.com / ~ / media / Documents / Products / Other%20Documents / ONF I 3_0Go l d.ashx, the meanings of target, logic unit, LUN, and plane are provided, which is part of the prior art. Summary of the invention

[0005] The software or firmware running in the storage device (for the purpose of clarity and simplicity, collectively referred to as firmware below, and the instruction sequence running in the computer or server accessing the storage device is referred to as software) needs to be fully tested to ensure the quality and reliability of the storage device. Testing software also tests the storage device including hardware.

[0006] As the firmware of storage devices is iteratively developed, the functions of storage devices become increasingly complex, and the targets to be checked by the test software also change accordingly. The test software needs to fully understand the features provided by the firmware of the storage device currently being tested, so as to know what features to be tested of the storage device currently being tested, as well as the acceptance criteria for these features to be tested.

[0007] However, the test software and storage device firmware are often developed by different teams. Due to their respective development progress, different teams often have different understandings of the characteristics of the current storage device being tested, which makes it difficult for the test software to accurately know the test characteristics of the storage device being tested, and / or sets incorrect acceptance criteria. For example, the test software needs to test the multi-namespace feature of the storage device, but the firmware of the storage device being tested does not yet support the multi-namespace feature. In this case, the test software prompts that the test failed, but it cannot confirm any defects in the storage device based on this. The above problems need to be solved.

[0008] According to the first aspect of the present application, a first storage device according to the first aspect of the present application is provided, comprising: a storage interface, a test interface, a test agent, a platform descriptor and firmware; the test agent receives a test command of a test device through the test interface, obtains a platform descriptor according to the test command, and provides the platform descriptor to the test device through the test interface; the firmware receives a storage command generated by the test device according to the platform descriptor through the storage interface, processes the storage command according to the platform descriptor to obtain a processing result, and provides the processing result to the test device through the storage interface.

[0009] According to the first storage device of the first aspect of the present application, the platform descriptor is recorded in a platform descriptor space of the storage device.

[0010] According to the second storage device of the first aspect of the present application, the platform descriptor space is a partial memory space of a control component of the storage device.

[0011] According to one of the first to third storage devices of the first aspect of the present application, the platform descriptor records the version of the storage device hardware / firmware, the features supported by the storage device, or the configuration information of the storage device.

[0012] According to one of the first to fourth storage devices of the first aspect of the present application, the test agent is provided by part of a control component of the storage device or provided by a CPU of the control component of the storage device running a program.

[0013] According to one of the first to fifth storage devices of the first aspect of the present application, the test agent enables the storage device to provide a test interface.

[0014] According to one of the first to sixth storage devices of the first aspect of the present application, the firmware runs on a CPU of a control component of the storage device.

[0015] According to one of the first to seventh storage devices of the first aspect of the present application, the platform descriptor records a test method for the storage device, and the storage command is generated according to the test method.

[0016] According to one of the first to eighth storage devices of the first aspect of the present application, a storage command for accessing a storage space range is generated according to a storage space size of the storage device indicated by a platform descriptor.

[0017] According to one of the first to ninth storage devices of the first aspect of the present application, a storage command for accessing a storage space outside the range of the storage space is generated according to a storage space size of the storage device indicated by a platform descriptor.

[0018] According to one of the first to tenth storage devices of the first aspect of the present application, the test agent also receives a test command instructing the test device to modify the platform descriptor through the test interface, and updates the platform descriptor according to the test command; the firmware also receives a storage command generated by the test device according to the updated platform descriptor through the storage interface, processes the storage command according to the updated platform descriptor to obtain a processing result, and provides the processing result to the test device through the storage interface.

[0019] According to one of the first to eleventh storage devices of the first aspect of the present application, the test agent generates a reboot command to instruct a control component of the storage device to reboot.

[0020] According to one of the first to eleventh storage devices of the first aspect of the present application, in response to the platform descriptor being updated, the firmware generates a restart command to instruct the control component of the storage device to restart.

[0021] According to one of the first to thirteenth storage devices of the first aspect of the present application, it includes a CPU with local parameters, wherein the test agent receives a test command sent by the test device, sends a message to the target CPU according to the test command to instruct the target CPU to modify the local parameters, and sends the processing result to the test device.

[0022] According to the fourteenth storage device of the first aspect of the present application, the test command includes an instruction to the target CPU, the target local parameter and the new value of the local parameter, and the target CPU updates the target local parameter to the new value of the local parameter in response to the obtain message.

[0023] According to the fourteenth storage device of the first aspect of the present application, the test command indicates a modification form of the target local parameter, and the target CPU responds to the acquisition message by modifying the local parameter according to the indicated modification form to obtain a new value of the target local parameter.

[0024] According to the fifteenth or sixteenth storage device of the first aspect of the present application, in response to the target local parameter being updated successfully, the firmware receives a storage command generated according to the new value of the target local parameter and sent by the test device.

[0025] According to one of the first to eleventh storage devices of the first aspect of the present application, the test command indicates a target CPU, an operation code, a return value size and / or one or more parameters.

[0026] According to the eighteenth storage device of the first aspect of the present application, the test agent receives a reset data packet sent by the test device before receiving the test command, and in response to receiving the reset data packet, the test agent sets its state to not ready.

[0027] According to the nineteenth storage device of the first aspect of the present application, the test command is sent according to a not-ready state of the test agent.

[0028] According to one of the eighteenth to twentieth storage devices of the first aspect of the present application, the test agent receives a submission data packet sent by the test device, and the submission data packet instructs the test agent to start processing the test command.

[0029] According to the twenty-first storage device of the first aspect of the present application, the test agent sends the test command to the indicated target CPU according to the submitted data packet, and receives the execution result of the test command from the target CPU.

[0030] According to one of the eighteenth to twenty-second storage devices of the first aspect of the present application, after the test agent completes processing of the test command, it sets its state to ready.

[0031] According to the twenty-third storage device of the first aspect of the present application, the test device obtains the execution result of the test command based on the storage device being in a ready state.

[0032] According to the second aspect of the present application, a first electronic device testing method according to the second aspect of the present application is provided, comprising the following steps: the electronic device receives a test command from a test device, obtains a platform descriptor according to the test command, and provides the platform descriptor to the test device; the test device generates a storage command according to the platform descriptor and sends it to the electronic device; the electronic device processes the storage command according to the platform descriptor to obtain a processing result, and provides the processing result to the test device.

[0033] According to the first electronic device testing method of the second aspect of the present application, the platform descriptor is recorded in the platform descriptor space of the electronic device.

[0034] According to the second electronic device testing method of the second aspect of the present application, the platform descriptor space is a part of the memory space of the control component of the electronic device.

[0035] According to one of the first to third electronic device testing methods of the second aspect of the present application, the platform descriptor records the version of the electronic device hardware / firmware, the features supported by the electronic device, or the configuration information of the electronic device.

[0036] According to one of the first to third electronic device testing methods of the second aspect of the present application, the platform descriptor records the testing method for the electronic device, and the testing device generates a storage command according to the testing method set in the platform descriptor.

[0037] According to one of the first to third electronic device testing methods of the second aspect of the present application, the testing device generates a storage command to access a storage space within the range of the electronic device according to the size of the electronic device storage space indicated in the platform descriptor.

[0038] According to one of the first to third electronic device testing methods of the second aspect of the present application, the testing device generates a storage command for accessing a storage space outside the range of the electronic device storage space according to the size of the electronic device storage space indicated in the platform descriptor.

[0039] According to one of the first to seventh electronic device testing methods of the second aspect of the present application, it also includes: the electronic device receives a test command from the test device instructing to modify the platform descriptor, and updates the platform descriptor according to the test command; the test device generates a storage command according to the updated platform descriptor and sends it to the electronic device; the electronic device processes the storage command according to the updated platform descriptor to obtain a processing result, and provides the processing result to the test device.

[0040] According to the eighth electronic device testing method of the second aspect of the present application, the testing device instructs the electronic device to restart after updating the platform descriptor.

[0041] According to the eighth electronic device testing method of the second aspect of the present application, it also includes: the electronic device receives a test command sent by the testing device, sends a message to the target CPU with local parameters according to the test command to instruct the target CPU to modify the local parameters, and sends the processing result to the testing device.

[0042] According to the tenth electronic device testing method of the second aspect of the present application, the test command includes instructions for a target CPU, a target local parameter and a new value of the local parameter, and the target CPU updates the target local parameter to the new value of the local parameter in response to obtaining the message.

[0043] According to the tenth electronic device testing method of the second aspect of the present application, the test command indicates a modification form of the target local parameter, and the target CPU responds to the acquisition message by modifying the local parameter according to the indicated modification form to obtain a new value of the target local parameter.

[0044] According to the eleventh or twelfth electronic device testing method of the second aspect of the present application, in response to the target local parameter being updated successfully, the testing device sends a storage command generated according to the new value of the target local parameter to the electronic device.

[0045] According to the thirteenth electronic device testing method of the second aspect of the present application, the test command indicates a target CPU, an operation code, a return value size and / or one or more parameters.

[0046] According to one of the eighth to fourteenth electronic device testing methods of the second aspect of the present application, the electronic device also receives a reset data packet sent by the test device before receiving the test command, and in response to receiving the reset data packet, the electronic device sets its status to not ready.

[0047] According to the fifteenth electronic device testing method of the second aspect of the present application, the testing device sends a test command based on the unready state of the electronic device.

[0048] According to the fifteenth or sixteenth electronic device testing method of the second aspect of the present application, the electronic device receives a submission data packet sent by the testing device, and the submission data packet instructs the electronic device to start processing the test command.

[0049] According to the seventeenth electronic device testing method of the second aspect of the present application, the electronic device sends a test command to an indicated target CPU according to a submitted data packet, and receives an execution result of the test command from the target CPU.

[0050] According to one of the eighth to eighteenth electronic device testing methods of the second aspect of the present application, after the electronic device completes processing of the test command, its state is set to ready.

[0051] According to the nineteenth electronic device testing method of the second aspect of the present application, the testing device obtains the execution result from the electronic device based on the electronic device being in a ready state.

[0052] According to the third aspect of the present application, a first electronic device testing method according to the third aspect of the present application is provided, including: using a platform descriptor to compile a firmware code into firmware for an electronic device; the electronic device receives a storage command generated by a test device according to the platform descriptor, and the firmware processes the storage command according to the platform descriptor to obtain a processing result, and provides the processing result to the test device.

[0053] According to the first electronic device testing method of the third aspect of the present application, the firmware compiled and generated using the platform descriptor has a test agent.

[0054] According to the first or second electronic device testing method of the third aspect of the present application, the electronic device receives a test command sent by a testing device, and the test command instructs the electronic device to access a platform descriptor maintained internally therein.

[0055] According to the third electronic device testing method of the third aspect of the present application, accessing the platform descriptor maintained inside the electronic device includes acquiring the platform descriptor or modifying the platform descriptor.

[0056] According to one of the first to fourth electronic device testing methods of the third aspect of the present application, the platform descriptor records whether a test agent is generated, whether the test agent is enabled, and / or whether a test interface is enabled.

[0057] According to one of the first to fourth electronic device testing methods of the third aspect of the present application, the platform descriptor records the version of the electronic device hardware / firmware, the features supported by the electronic device and / or the configuration information of the electronic device.

[0058] According to one of the first to fourth electronic device testing methods of the third aspect of the present application, if the platform descriptor describes the storage space size, then the corresponding firmware code segment is selected according to the storage space size and the corresponding firmware is compiled.

[0059] According to one of the first to fourth electronic device testing methods of the third aspect of the present application, if the platform descriptor describes the version of the firmware, the compiled firmware is marked with the version described by the platform descriptor.

[0060] According to one of the first to fourth electronic device testing methods of the third aspect of the present application, wherein, if the platform descriptor describes the enabling status of the storage device feature, the compiled firmware has the enabled feature; and wherein the storage command generated by the received test device is a storage command for testing the enabled feature. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0062] Figure 1 A block diagram of a storage device of the prior art is shown;

[0063] Figure 2 is a schematic diagram of a test storage device according to an embodiment of the present application;

[0064] Figure 3 A flowchart of testing software testing a storage device according to an embodiment of the present application is shown;

[0065] Figure 4 A flowchart of testing software testing a storage device according to another embodiment of the present application is shown;

[0066] Figure 5 is a schematic diagram of a test storage device according to another embodiment of the present application;

[0067] Figure 6is a schematic diagram of the test software sending a test command to the test agent according to an embodiment of the present application;

[0068] Figure 7 A flowchart showing the test agent processing a test command according to an embodiment of the present application is shown;

[0069] Figure 8 is a schematic diagram of a test storage device according to another embodiment of the present application;

[0070] Fig. 9 Demonstrated according to this application Figure 8 A flowchart of an embodiment of testing a storage device. DETAILED DESCRIPTION

[0071] The following is a clear and complete description of the technical solutions in the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.

[0072] Figure 2 is a schematic diagram of a test storage device according to an embodiment of the present application.

[0073] See also Figure 2 , the firmware 214 of the storage device 210 is coupled to the storage interface 211 (e.g., NVMe interface) and processes the storage command received from the storage interface 211. The firmware 214 also accesses the platform descriptor space 213 to obtain or update the platform descriptor. The storage device 210 also includes a test agent 215. For example, the test agent 215 is part of the control component of the storage device 210, or the CPU of the control component runs a program to provide the test agent 215.

[0074] The test agent 215 enables the storage device 210 to provide a test interface 212 for receiving a test command provided by the test software, and according to the test command, obtains part or all of the platform descriptor from the platform descriptor space 213 and provides it to the test program.

[0075] According to an embodiment of the present application, the storage device 210 provides two access interfaces to the outside. One access interface (referred to as storage interface 211) is used to couple to a host and receive commands provided by the host for accessing the storage function of the storage device 210. For example, interfaces supporting storage protocols such as NVMe and SATA. Another access interface (referred to as test interface 212) is used to couple to a test device 220 and provide description information of the storage device 210 to the test device 220. The test interface 212 complies with, for example, a KV (key-value) interface.

[0076] exist Figure 2 In the example, the test device 220 and the host accessing the storage device 210 are the same computer or server. And the storage interface 211 and the test interface 212 are carried by the same physical link, for example, both are carried by a PCIe link. It can be understood that the test interface 212 and the storage interface 211 can use the same PCIe link, or use their own PCIe links. Still optionally, the test interface 212 uses one PCIe port of the storage device 210, and the storage interface 211 uses another PCIe port of the storage device 210.

[0077] Test software is running on the test device 220. In some cases, the test software is compiled executable code and is run by the test device 220. In other cases, the test software is a test script interpreted and executed by the test device 220. By running the test software, the test device 220 generates a test command sent to the storage device 210 through the test interface 212, and a storage command sent to the storage device 210 through the storage interface 211.

[0078] The platform descriptor space 213 is maintained in the storage device 210. For example, the platform descriptor is recorded in the memory of the control component of the storage device 210. The storage space for recording the platform descriptor is called the platform descriptor space 213. The platform descriptor records the version of the current version of the storage device (including hardware and firmware), supported features, configuration and other information. As an example, the features supported by the storage device include dual ports, multiple namespaces, QoS, etc., and the configuration of the storage device includes storage space capacity, number of NVM chips, memory size, log area storage location, etc.

[0079] According to an embodiment of the present application, the platform descriptor is used by both the firmware 214 and the test agent 215. Since the same platform descriptor is used by both the firmware 214 and the test agent 215, it is ensured that the characteristics of the storage device 210 known to the test software are consistent with the characteristics of the storage device 210 provided by the firmware 214, thereby ensuring the effective conduct of the test process. For example, when the firmware 214 of the storage device 210 is initialized, it is necessary to know the size of the storage space presented to the user by the storage device 210, for example, 1TB. The firmware 214 obtains the size of the storage space presented to the user by the storage device 210 through the platform descriptor, and the test software also obtains the storage space size from the platform descriptor, and then the test software only generates storage device access commands within the range of 0-1TB to test the storage device 210, thereby avoiding errors introduced by the test software accessing a storage space greater than 1TB.

[0080] Optionally, the test agent 215 also updates the platform descriptor in response to a test command provided by the test software.

[0081] In one embodiment, the firmware 214 of the storage device 210 also sets a platform descriptor. For example, an indication of a test method for the storage device 210 is set in the platform descriptor. For example, the firmware 214 enables the storage device 210 to provide 32 namespaces, and the firmware 214 also indicates that during the test process, a storage command should be sent to each namespace in turn, and then a storage command should be sent to each namespace at the same time. During the test implementation process, the test software obtains the test method indicated by the firmware 214 from the platform descriptor through the test agent 215, and generates and executes two test cases based on the obtained test method. In the first test case, a storage command is sent to each namespace in turn, and in the second test case, a storage command is sent to each namespace at the same time.

[0082] Figure 3 A flowchart of testing software testing a storage device according to an embodiment of the present application is shown.

[0083] According to an embodiment of the present application, in order to test a storage device, the test software first obtains a platform descriptor (310) of the storage device through a test interface, and the platform descriptor records the configuration information of the storage device firmware. The test software generates a storage command for testing the storage device according to the obtained platform descriptor, and sends the generated storage command to the storage device through the storage interface (320). As an example, the test software knows the storage space size of the storage device from the obtained platform descriptor, and generates a storage command within (or outside) the storage space range of the storage device for the purpose of testing.

[0084] The storage device processes the storage command sent by the test software and received from the storage interface according to the storage space size of the storage device obtained from the platform descriptor, and provides the test software (330) with the storage command processing result through the storage interface.

[0085] The test software and the storage device firmware access the same platform descriptor to obtain required information (eg, storage space size), thereby avoiding inconsistencies between the test software and the storage device firmware.

[0086] It should be pointed out that the test software obtains the storage space size through the platform descriptor and can still generate storage commands outside the storage space of the storage device to test whether the storage device firmware's response to such abnormal situations meets the design requirements.

[0087] Figure 4 A flowchart of testing software testing a storage device according to yet another embodiment of the present application is shown.

[0088] according to Figure 4In the embodiment shown, during the test software testing the storage device, the platform descriptor is modified so that the characteristics of the storage device are changed, and the test software also tests the storage device after the characteristic change occurs, thereby eliminating the inconvenience of installing different versions of firmware in the storage device and testing the different versions of firmware separately.

[0089] according to Figure 4 In the embodiment shown, in order to test the storage device, the test software first obtains the platform descriptor of the storage device through the test interface (410). The test software generates a storage command for testing the storage device according to the obtained platform descriptor, and sends the generated storage command to the storage device through the storage interface (420). In response to the received storage command, the storage device processes the storage command sent by the test software from the storage interface according to the storage space size of the storage device obtained from the platform descriptor, and provides the storage command processing result to the test software through the storage interface (430). The test software identifies whether the storage device is working normally based on the processing result of the storage command and the storage command previously issued to the storage device.

[0090] Optionally or further, the test software sends a test command to the test interface, instructing to modify part or all of the platform descriptor (440). The test agent receives the test command and updates the platform descriptor space according to the test command. Optionally, the test agent also generates a restart command to instruct the control component to restart so that, for example, the updated platform descriptor takes effect. Still optionally, the firmware generates a restart command in response to the platform descriptor being updated.

[0091] For example, the storage space size provided by the storage device indicated by the platform descriptor is modified through the test command. As another example, the storage device is modified from supporting multiple command spaces to not supporting multiple name spaces.

[0092] Optionally, the test agent also provides the storage device with firmware to be updated, for example, writes the firmware to be updated into a designated area of ​​the NVM chip of the storage device, and enables the storage device to run the updated firmware.

[0093] Since the test software indicates the update of the platform descriptor, the test software knows the storage device characteristics corresponding to the updated platform descriptor. The test software generates a storage command according to the modified platform descriptor and sends the storage command to the storage device through the storage interface (450).

[0094] In response to the received storage command, the storage device processes the storage command sent by the test software and received from the storage interface according to the storage device characteristics obtained from the updated platform descriptor, and provides the storage command processing result to the test software through the storage interface (460). The test software identifies whether the storage device is working normally based on the storage command processing result and the storage command previously issued to the storage device.

[0095] Figure 5 is a schematic diagram of a test storage device according to another embodiment of the present application.

[0096] According to an embodiment of the present application, the storage device 510 provides a storage interface 511 and a test interface 512 externally.

[0097] The storage device 510 maintains a platform descriptor space 513 in which platform descriptors are recorded.

[0098] The control component of the storage device 510 further includes a plurality of CPUs and a test agent 515. Firmware is run on each CPU, and firmware 514 is run on CPU 1. Optionally, the test agent 515 is also provided by the CPU running an instruction sequence.

[0099] The platform descriptor is used by both the firmware 514 and the test agent 515. Since the same platform descriptor is used by both the firmware 514 and the test agent 515, it is ensured that the characteristics of the storage device 510 known by the test device 520 are consistent with the characteristics of the storage device 510 provided by the firmware 514, thereby ensuring the effective conduct of the test process.

[0100] See also Figure 5 , the firmware 514 executed by CPU 1 is coupled to the storage interface 511 (eg, NVMe interface), and processes the storage command received from the storage interface 511. The firmware 514 also accesses the platform descriptor space 513 to obtain or update the platform descriptor.

[0101] The test agent 515 enables the storage device 510 to provide a test interface 512 for receiving a test command provided by the test device 520 , and obtains part or all of the platform descriptor from the platform descriptor space 513 according to the test command, and provides it to the test device 520 .

[0102] One or more CPUs (e.g., CPU 2 and CPU 3) of the control component have local parameters. The local parameters of CPU 2 are only used by CPU 2, and the local parameters of CPU 3 are only used by CPU 3. In some cases, the test software hopes to modify the local parameters of the CPU. For example, CPU 2 performs an error correction function on data. The test software verifies the role played by the error correction function, so it is necessary to enable CPU 2 to obtain data with errors. In general, errors in data in the memory are low-probability events, and the test software needs to artificially modify the data to erroneous data to verify the correctness of the error correction function. For this purpose, the test software sends a test command to the test agent 515 through the test interface 512. The test command indicates the target CPU, the target local parameters, and the new value of the local parameters.

[0103] In response to receiving the test command, the test agent 515 sends a message to the target CPU, instructing the target CPU to update the target local parameter to a new value. In response to obtaining the message, the target CPU updates the target local parameter to a new value. The target CPU continues to run the firmware 514 using the updated local parameter. Optionally, the test command indicates other meanings. For example, the test command instructs the target CPU to perform a specified modification on the number indicated by the local parameter to obtain error data before performing error correction on the number.

[0104] Optionally, the target CPU also informs the test agent 515 that the target local parameters are updated successfully. The test agent 515 informs the test software that the target local parameters of the target CPU are updated successfully. Thus, the test software can send a storage command or a test command to the storage device 510 according to the updated target local parameters of the target CPU.

[0105] Figure 6 It is a schematic diagram of the test software sending a test command to the test agent according to an embodiment of the present application.

[0106] As an example, the test command indicates the target CPU (Node ID), operation code (cpCode), return value size (retSize) and one or more parameters (param0). According to the test command, the test agent also sends the processing result (return value) of the test command to the test software. The return value of the test command may have different sizes. In the case of limited size of the data packet carried on the link of the test interface (for example, TLP of the PCIe protocol), a complete return value is composed of multiple data packets (Ret 0, Ret 1, Ret2).

[0107] The test agent also provides the test software with the test agent status to synchronize the various stages of sending test commands (and receiving return values) between the test software and the test agent. Figure 6, the test software sends a reset data packet to the test agent to indicate that a test command is to be started. In response to receiving the reset data packet, the test agent cancels all test commands that have not been processed and sets the test agent status to "not ready". The test software can obtain the test agent status.

[0108] Next, the test software sends the target CPU (Node ID), operation code (cpCode), return value size (retS i ze) and one or more parameters (param0) in the test command to the test agent. Next, the test software also sends a "submit" data packet to the test agent to indicate that the test command has been sent and the test agent can start processing the test command. After the test agent completes processing the test command, it sets the test agent status to "ready". After the test software obtains the test agent status as "ready" regularly or irregularly, it obtains one or more return values ​​provided by the test agent for the test command. Since the test software knows the return value size specified in the test command, the test software obtains a specified number of return values ​​from the test agent according to the return value size.

[0109] Continue to view Figure 6 , as an example, Figure 6 Each row in represents a specified register or a specified memory space provided by the test agent through the test interface. For example, the test agent provides the starting address A1 in the memory space to receive the "reset" and "submit" data packets sent by the test software, and the test software writes the "reset" or "submit" data packets to the starting address A1 of the memory space. The test agent provides the starting address A2 in the memory space to receive the test command data packet (target CPU (Node ID), operation code (cpCode), return value size (retS i ze) and one or more parameters (param0) etc.) sent by the test software, and the test software writes the test command data packet to the starting address A2 of the memory space. The test agent provides the starting address A3 of the memory space to indicate the test agent status, and the test agent writes the test agent status to the starting address A3 of the memory space for the test software to read.

[0110] Figure 7 A flowchart of a test agent processing a test command according to an embodiment of the present application is shown.

[0111] In response to receiving the "reset" data packet provided by the test software, the test agent begins to prepare to receive test commands and sets the test agent state to "not ready" (710). The test software may start transmitting test commands to the test agent based on the test agent being in the "not ready" state, or may start transmitting test commands randomly after sending the "reset" data packet without checking the test agent state.

[0112] The test agent receives the first data packet in the test command provided by the test software and uses it as an indication of the target CPU (Node ID) (720). The test agent receives the second data packet in the test command provided by the test software and uses it as an indication of the operation code (cpCode) (730). The test agent receives the third data packet in the test command provided by the test software and uses it as an indication of the return value size (retS i ze) (740).

[0113] The test agent receives other subsequent data packets in the test command provided by the test software (750) and uses them as one or more parameters (param0) of the test command. Optionally, the test agent limits the number of test command parameters received (760), for example, limiting the test command parameters to no more than 16 data packets. For data packets received that exceed the specified threshold, the test agent indicates that an erroneous test command has been received and refuses to receive it (770).

[0114] In response to receiving the "submit" data packet provided by the test software, the test agent knows that the reception of a test command is complete and starts to process the test command (780). For example, the test command is sent to the target CPU (NodeID) indicated by the test command, and the execution result of the test command is received from the target CPU. In response to receiving the execution result of the test command provided by the target CPU, the test agent sets the test agent state to "ready" (790).

[0115] The test software starts to read the processing result of the test command from the test agent according to the test agent being in the "ready" state. The test software reads a specified number of data packets according to the return value size (retS i ze) of the test command to obtain the processing result (711), and outputs the data packets (712). Optionally, if the number of data packets read by the test software exceeds the return value size (retS i ze), the test agent may refuse to provide the test software with the data exceeding the return value size (retS i ze) (713).

[0116] Figure 8 is a schematic diagram of a test storage device according to another embodiment of the present application.

[0117] according to Figure 8 In the illustrated embodiment, the platform descriptor is described in the platform descriptor file 810. The platform descriptor records the version of the current storage device (including hardware and firmware), supported features, configuration, etc. The compiler 830 compiles the firmware code 820 to generate firmware 840. The script engine 850 runs the test software described by the test software 860 to implement the test process.

[0118] The firmware code 820 references the platform descriptor to obtain the configuration information of the storage device being operated. For example, the firmware code 820 obtains the size of the storage space of the storage device described in the platform descriptor, and selects the corresponding code segment according to the size of the storage space. For example, the size of the storage space is used as a basis for determining whether the branch condition is established in the branch condition of the firmware code 820. In another example, the compiler 830 references the platform descriptor to obtain the version of the firmware 840 to be generated, and marks the obtained version in the generated firmware 840.

[0119] As another example, the firmware code 820 references the platform descriptor to determine whether one or more storage device features are enabled. For example, the storage device firmware may support features F1, F2, and F3, and the platform descriptor specifies that features F1 and F2 are enabled, and feature F3 is not enabled. The compiler 830 generates firmware 840 based on the firmware code 820 according to the platform descriptor, and the generated firmware 840 includes executable program segments corresponding to features F1 and F2, but does not include executable program segments corresponding to feature F3.

[0120] According to an embodiment of the present application, the test software also uses the platform descriptor. Thus, the test software obtains the same configuration information of the storage device as seen by the firmware code 820 or the compiler 830. This allows the test software to implement the test process according to the configuration of the storage device. For example, the platform descriptor indicates the size of the storage space of the storage device, so the storage command for testing generated by the test software accesses the inside and / or outside of the storage space according to the test purpose. As another example, the test software 860 generates storage commands for testing the characteristics F1 and F2 based on the platform descriptor indicating that the storage device has enabled the characteristics F1 and F2, and avoids generating storage commands for testing the unenabled characteristic F3, so as to ensure the smooth progress of the test process.

[0121] In another embodiment, the platform descriptor describes the instructions for the test method of the storage device. For example, the storage device provides 32 namespaces, and the platform descriptor indicates that during the test, the storage command should be sent to each namespace in turn, and then the storage command should be sent to each namespace at the same time. During the test implementation process, the test software 860 is run by the script engine 850 to obtain the test method from the platform descriptor, and generates and executes two test cases based on the obtained test method. In the first test case, the storage command is sent to each namespace in turn, and in the second test case, the storage command is sent to each namespace at the same time.

[0122] Fig. 9 Demonstrated according to this application Figure 8 A flowchart of an embodiment of testing a storage device.

[0123] according to Fig. 9 In an embodiment of the present invention, the compiler compiles the firmware code into the firmware as an executable program using the platform descriptor (910).

[0124] The test software also references the platform descriptor. The test software is executed by the script engine to obtain the configuration information of the storage device recorded in the platform descriptor to generate a storage command. The generated storage command is sent to the storage device through the storage interface (920). The firmware of the storage device uses the configuration information obtained from the platform descriptor during compilation to process the received storage command. And the processing result of the storage command is sent to the test software through the storage interface (930). The test software tests the storage device according to whether the issued storage command is consistent with the execution result received from the storage device.

[0125] In an optional embodiment, the compiled firmware also maintains the platform descriptor inside the storage device when it is run. The storage device also includes a test agent and a test interface. When the storage device is running, the test software sends a test command to the test agent through the test interface to instruct the test agent to access (acquire and / or modify) the platform descriptor maintained inside the storage device, so as to update the platform descriptor when the storage device is running, and generate a storage command for testing the storage device according to the updated platform descriptor. Still optionally, whether to enable the test agent and the test interface is also a storage device characteristic indicated in the platform descriptor. The compiler generates firmware with or without a test agent based on the instructions of the platform descriptor. The test software knows whether the storage device currently being tested has a test agent, whether it can accept test commands, and / or which test commands can be accepted based on the instructions of the platform descriptor.

[0126] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they are aware of the basic creative concepts. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present application. Obviously, those skilled in the art may make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A storage device, include: Storage interfaces, test interfaces, test agents, platform descriptors, and firmware; The test agent receives the test command from the test device through the test interface, obtains the platform descriptor according to the test command, and provides the platform descriptor to the test device through the test interface; The firmware receives a storage command generated by the test device according to the platform descriptor through the storage interface, processes the storage command according to the platform descriptor to obtain a processing result, and provides the processing result to the test device through the storage interface; The platform descriptor records the version of the electronic device hardware / firmware, the features supported by the electronic device, or the configuration information of the electronic device; The platform descriptor records the test method for the electronic device, and the test device generates a storage command according to the test method set in the platform descriptor.

2. A method for testing electronic equipment, The following steps are involved: The electronic device receives a test command from the test device, obtains a platform descriptor according to the test command, and provides the platform descriptor to the test device; The test device generates a storage command according to the platform descriptor and sends the command to the electronic device; The electronic device processes the storage command according to the platform descriptor to obtain a processing result, and provides the processing result to the test device; The platform descriptor records the version of the electronic device hardware / firmware, the features supported by the electronic device, or the configuration information of the electronic device; The platform descriptor records the test method for the electronic device, and the test device generates a storage command according to the test method set in the platform descriptor.

3. The electronic device testing method according to claim 2, in, Also includes: The electronic device receives a test command from the test device instructing to modify the platform descriptor, and updates the platform descriptor according to the test command; The test device generates a storage command according to the updated platform descriptor and sends the storage command to the electronic device; The electronic device processes the storage command according to the updated platform descriptor to obtain a processing result, and provides the processing result to the test device.

4. The electronic device testing method according to claim 2 or 3, in, Also includes: The electronic device receives the test command sent by the test device, sends a message to the target CPU with local parameters according to the test command to instruct the target CPU to modify the local parameters, and sends the processing result to the test device.

5. A method for testing electronic equipment, include: compiling the firmware code into firmware for the electronic device using the platform descriptor; The electronic device receives a storage command generated by the test device according to the platform descriptor, and the firmware processes the storage command according to the platform descriptor to obtain a processing result, and provides the processing result to the test device; The platform descriptor records the version of the electronic device hardware / firmware, the features supported by the electronic device, or the configuration information of the electronic device; The platform descriptor records the test method for the electronic device, and the test device generates a storage command according to the test method set in the platform descriptor.

6. The electronic device testing method according to claim 5, in, The electronic device receives a test command sent by the test device, where the test command instructs the electronic device to access a platform descriptor maintained internally therein.

7. The electronic device testing method according to claim 6, in, The platform descriptor records whether a test agent is generated, whether the test agent is enabled, and / or whether a test interface is enabled.

8. The electronic device testing method according to claim 6, in, If the platform descriptor describes the enabling status of the storage device feature, the compiled firmware has the enabled feature; and the storage command generated by the test device received therein is a storage command for testing the enabled feature.