Disclosure of Invention
Therefore, the invention aims to provide a disc automatic test method, device, equipment and storage medium, which have higher automation and control degree in the whole test process, avoid manual intervention errors and improve test efficiency. The specific scheme is as follows:
a first aspect of the present application provides a method for automatically testing a disc, including:
acquiring initial smart information of a disc to be tested on a test end, and analyzing the initial smart information to obtain corresponding initial target parameters;
generating a test instruction according to a test requirement and sending the test instruction to the test end so that the test end performs a first test on a preset test item of the disc to be tested according to the test instruction;
and if the first test is passed, performing a second test by using a final target parameter corresponding to the final smart information of the disc to be tested after the first test and the initial target parameter, and if the second test is passed, judging that the disc to be tested is qualified.
Optionally, before the obtaining the initial smart information of the disc to be tested on the test end, the method further includes:
initializing the test end;
and starting the control end according to the access authority, and loading preset test information comprising the preset test item on the control end.
Optionally, the generating a test instruction according to a test requirement and sending the test instruction to the test end, so that the test end performs a first test on a preset test item of the disc to be tested according to the test instruction, including:
determining the interface type of the disc to be tested by using the analyzed initial smart information to obtain corresponding test requirements;
generating a test instruction according to the test requirement and sending the test instruction to the test end so that the test end starts a test thread corresponding to the test instruction to perform a first test on a preset test item of the disc to be tested.
Optionally, the parsing the initial smart information to obtain corresponding initial target parameters includes:
analyzing the initial smart information, and determining the model name, serial number and remapped sector number of the disc to be tested in the analyzed initial smart information as initial target parameters.
Optionally, the performing a second test by using a final target parameter corresponding to the final smart information of the disc to be tested after the first test and the initial target parameter includes:
acquiring final smart information of the disc to be tested after the first test, analyzing the final smart information, and determining the model name, serial number and remapped sector number of the disc to be tested in the analyzed final smart information as final target parameters;
and judging whether the final target parameters are consistent with the initial target parameters, and if so, passing a second test.
Optionally, the automated testing method for a disc further includes:
and respectively generating a first test log corresponding to the first test and/or a second test log corresponding to the second test, and obtaining a final test log according to the first test log and/or the second test log when the disc to be tested is judged to be qualified.
Optionally, the automated testing method for a disc further includes:
and receiving a real-time test result of the disc to be tested returned by the test end, and outputting the real-time test result to a man-machine interaction interface of the control end for real-time display.
A second aspect of the present application provides a disc automated testing apparatus comprising:
the acquisition module is used for acquiring initial smart information of the disc to be tested on the test end and analyzing the initial smart information to obtain corresponding initial target parameters;
the first test module is used for generating a test instruction according to a test requirement and sending the test instruction to the test end so that the test end can perform a first test on a preset test item of the disc to be tested according to the test instruction;
and the second test module is used for carrying out a second test by utilizing a final target parameter corresponding to the final smart information of the disc to be tested after the first test and the initial target parameter if the first test is passed, and judging that the disc to be tested passes the test if the second test is passed.
A third aspect of the present application provides an electronic device comprising a processor and a memory; wherein the memory is for storing a computer program that is loaded and executed by the processor to implement the aforementioned disk automated test method.
A fourth aspect of the present application provides a computer readable storage medium having stored therein computer executable instructions that, when loaded and executed by a processor, implement the foregoing disc automation test method.
In the application, initial smart information of a disc to be tested on a test end is acquired first, and the initial smart information is analyzed to obtain corresponding initial target parameters; then, generating a test instruction according to a test requirement and sending the test instruction to the test end so that the test end performs a first test on a preset test item of the disc to be tested according to the test instruction; and finally, if the first test is passed, performing a second test by utilizing a final target parameter and the initial target parameter which correspond to the final smart information of the disc to be tested after the first test, and if the second test is passed, judging that the disc to be tested is qualified. Therefore, before the first test is carried out on the preset test item of the disc to be tested, the initial target parameter is obtained by acquiring and analyzing the initial smart information of the disc to be tested, and on the basis that the first test passes, the second test is further carried out by utilizing the final target parameter corresponding to the final smart information of the disc to be tested and the initial target parameter, so that the whole test process is high in automation and controllability, manual intervention errors are avoided, and the test efficiency is improved.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
At present, in single production test, the test is generally executed one by one through manual intervention, the test result is recorded manually, and the like, so that automatic production test cannot be performed in batches and on a large scale. The manual intervention test not only consumes a great deal of manpower and material resources, but also is inconvenient to operate and is easy to generate test errors, so that the test result is inaccurate, the quality of a disc cannot be ensured, and the viscosity of a user is reduced. Aiming at the technical defects, the application provides a disc automation test scheme, which obtains initial target parameters by acquiring and analyzing initial smart information of a disc to be tested before a preset test item of the disc to be tested is subjected to a first test, and further performs a second test by utilizing final target parameters corresponding to final smart information of the disc to be tested and the initial target parameters on the basis of passing the first test, so that the whole test process is automatic and has higher controllable degree, manual intervention errors are avoided, and the test efficiency is improved.
Fig. 1 is a flowchart of a disc automated testing method according to an embodiment of the present application. Referring to fig. 1, the disc automation test method is applied to a control end, and includes:
s11: and acquiring initial smart information of the disc to be tested on the test end, and analyzing the initial smart information to obtain corresponding initial target parameters.
In this embodiment, initial smart information of a disc to be tested on a test end is obtained, and the initial smart information is analyzed to obtain corresponding initial target parameters. The control end interface is shown in fig. 2, through which test information, start test information and the like can be input and displayed. The control end, namely the control machine, and correspondingly the test end, namely the execution machine, wherein the control machine and the execution machine are carried on a Windows platform to automatically execute production test. It will be appreciated that the execution machine needs to be initialized and the control machine started before the test is performed. Specifically, the test terminal is initialized, then the control terminal is started according to the access authority, and preset test information comprising the preset test items is loaded on the control terminal. Referring to fig. 3, in an actual production test, the disc to be tested is inserted into the empty tester, and then the tester is initialized. And when the disc to be tested is identified by the testing machine and the client.py program on the testing machine runs normally, the initialization of the testing machine is successful. If the initialization fails, reinserting the disc to be tested, and initializing the testing machine again. And if the initialization of the testing machine is successful, logging in a control system of the control machine, loading and storing a testing configuration file, namely the preset testing information comprising the preset testing items.
In this embodiment, after the test is started, the smart information of the disc to be tested is obtained first and stored in a smart. Txt document, and the smart technology (Self-Monitoring Analysis and Reporting Technology) is also a Self-monitoring, analyzing and reporting technology. And then analyzing the initial smart information, and determining the model name, serial number and remapped sector number of the disc to be tested in the analyzed initial smart information as initial target parameters. The Model name (Model name), the Serial number (Serial number) and the remapped sector number (Relocated Sector Count) are main performance parameters of the disc to be measured, and of course, other types of analyzed parameters besides the above three parameters are also included in the protection scope of the present application as the target parameters. In order to perform real-time control and timely feedback on the disc to be tested in the test process, the analyzed model name, the analyzed serial number and the analyzed remapped sector number can be transmitted back to a control system of the control end in real time and displayed on an interface of the control end. The control end can also receive other disc information sent by the testing machine, and the other disc information can be displayed on the control end page so as to monitor the disc testing state in real time and discover the NG disc in time.
S12: generating a test instruction according to a test requirement and sending the test instruction to the test end so that the test end performs a first test on a preset test item of the disc to be tested according to the test instruction.
In this embodiment, a test instruction is generated according to a test requirement and sent to the test end, so that the test end performs a first test on a preset test item of the disc to be tested according to the test instruction, performs various tests, automatically determines a test result, and returns the test result to the control system in real time. The test requirements, namely the test related information, are input in the interface shown in fig. 2, including but not limited to the test machine IP, the work order number, the ERP material number, etc., prompting SUCCESS information, if not, prompting FAIL information, if yes, indicating failure, re-inputting the test related information, and clicking the start button to send the related instruction again. The preset test items include, but are not limited to, performance tests, restart tests, sleep tests, and the like.
The existing production test cannot be compatible with two types of discs, namely SATA and NVMe, and needs manual single-item execution distinction, wherein SATA (Serial Advanced Technology Attachment) is a serial advanced technology attachment and is a serial hardware driver interface based on industry standards. NVMe (Non-Volatile Memory express) is a Non-volatile memory management host system controller pass interface specification. Before testing, the types of the discs to be tested are distinguished, corresponding commands are called for the discs with different interface types to execute testing, and simultaneously, the discs with the two types of SATA and NVMe are supported. Specifically, firstly, determining the interface type of the disc to be tested by using the analyzed initial smart information to obtain a corresponding test requirement, then generating a test instruction according to the test requirement and sending the test instruction to the test end so that the test end starts a test thread corresponding to the test instruction to perform a first test on a preset test item of the disc to be tested.
S13: and if the first test is passed, performing a second test by using a final target parameter corresponding to the final smart information of the disc to be tested after the first test and the initial target parameter, and if the second test is passed, judging that the disc to be tested is qualified.
In this embodiment, if the first test passes, a second test is performed by using a final target parameter and the initial target parameter corresponding to the final smart information of the disc to be tested after the first test, and if the second test passes, the disc to be tested is determined to be qualified. Correspondingly, acquiring final smart information of the disc to be tested after the first test, analyzing the final smart information, determining the model name, serial number and remapped sector number of the disc to be tested in the analyzed final smart information as final target parameters, judging whether the final target parameters are consistent with the initial target parameters, and if so, passing a second test. Specifically, after all the test items pass, the disc smart information is acquired and analyzed again, and is compared with the model name, the serial number and the remapped sector number analyzed in the step S11, if the corresponding attribute values are completely consistent, the test passes, otherwise, the test does not pass.
The embodiment is mainly used for automatic production test under Windows platform, is compatible with two types of discs of SATA and NVMe, hangs test discs on corresponding test machines, issues test commands to the test machines through a control system, and automatically executes test and result judgment. On the basis, in order to facilitate traceability of test information, a test log can be generated in a test, specifically, a first test log corresponding to the first test and/or a second test log corresponding to the second test are respectively generated, and when the disc to be tested is judged to be qualified, a final test log is obtained according to the first test log and/or the second test log. If a certain test item fails in the first test, directly generating a test log, recording the failed test item, and ending the whole test. If the first test is completely passed, after the disc smart information is checked in a comparison way, a test log is generated, and the whole test is ended. In addition, as described above, the state information, the test result and the like can be monitored in real time through interface display, that is, the real-time test result of the disc to be tested returned by the test end is received, and the real-time test result is output to the man-machine interface of the control end for real-time display, so that the test state is monitored in real time, the test state is easy to observe by a tester, and the abnormal test condition is found in time.
As can be seen, in the embodiment of the present application, initial smart information of a disc to be tested on a test end is first obtained, and the initial smart information is parsed to obtain corresponding initial target parameters; then, generating a test instruction according to a test requirement and sending the test instruction to the test end so that the test end performs a first test on a preset test item of the disc to be tested according to the test instruction; and finally, if the first test is passed, performing a second test by utilizing a final target parameter and the initial target parameter which correspond to the final smart information of the disc to be tested after the first test, and if the second test is passed, judging that the disc to be tested is qualified. Before a first test is carried out on a preset test item of a disc to be tested, the initial target parameter is obtained by acquiring and analyzing initial smart information of the disc to be tested, and on the basis that the first test passes, a second test is further carried out by utilizing a final target parameter corresponding to final smart information of the disc to be tested and the initial target parameter, so that the whole test process is high in automation and controllability, human intervention errors are avoided, and the test efficiency is improved.
Referring to fig. 4, the embodiment of the present application further correspondingly discloses a disc automation testing device, which is applied to a control end and includes:
the acquisition module 11 is configured to acquire initial smart information of a disc to be tested on a test end, and analyze the initial smart information to obtain corresponding initial target parameters;
the first test module 12 is configured to generate a test instruction according to a test requirement and send the test instruction to the test end, so that the test end performs a first test on a preset test item of the disc to be tested according to the test instruction;
and the second test module 13 is configured to perform a second test by using a final target parameter corresponding to the final smart information of the disc to be tested after the first test and the initial target parameter if the first test passes, and determine that the disc to be tested passes the test if the second test passes the first test.
As can be seen, in the embodiment of the present application, initial smart information of a disc to be tested on a test end is first obtained, and the initial smart information is parsed to obtain corresponding initial target parameters; then, generating a test instruction according to a test requirement and sending the test instruction to the test end so that the test end performs a first test on a preset test item of the disc to be tested according to the test instruction; and finally, if the first test is passed, performing a second test by utilizing a final target parameter and the initial target parameter which correspond to the final smart information of the disc to be tested after the first test, and if the second test is passed, judging that the disc to be tested is qualified. Before a first test is carried out on a preset test item of a disc to be tested, the initial target parameter is obtained by acquiring and analyzing initial smart information of the disc to be tested, and on the basis that the first test passes, a second test is further carried out by utilizing a final target parameter corresponding to final smart information of the disc to be tested and the initial target parameter, so that the whole test process is high in automation and controllability, human intervention errors are avoided, and the test efficiency is improved.
In some embodiments, the obtaining module 11 is specifically configured to parse the initial smart information, and determine a model name, a serial number, and a remapped sector number of the disc to be tested in the parsed initial smart information as an initial target parameter;
correspondingly, the second test module 13 specifically includes:
the analyzing unit is used for acquiring the final smart information of the disc to be tested after the first test, analyzing the final smart information and determining the model name, the serial number and the number of remapped sectors of the disc to be tested in the analyzed final smart information as final target parameters;
and the judging unit is used for judging whether the final target parameter is consistent with the initial target parameter, and if so, the second test is passed.
In some embodiments, the first test module 12 specifically includes:
the interface determining unit is used for determining the interface type of the disc to be tested by using the analyzed initial smart information to obtain corresponding test requirements;
the instruction generating unit is used for generating a test instruction according to the test requirement and sending the test instruction to the test end so that the test end starts a test thread corresponding to the test instruction to perform a first test on a preset test item of the disc to be tested.
In some embodiments, the automated disk testing apparatus further comprises:
the initialization module is used for initializing the test terminal, starting the control terminal according to the access authority, and loading preset test information comprising the preset test item on the control terminal;
the log generation module is used for respectively generating a first test log corresponding to the first test and/or a second test log corresponding to the second test, and obtaining a final test log according to the first test log and/or the second test log when the disc to be tested is judged to be qualified;
and the display module is used for receiving the real-time test result of the disc to be tested returned by the test end and outputting the real-time test result to the man-machine interaction interface of the control end for real-time display.
Further, the embodiment of the application also provides electronic equipment. Fig. 5 is a block diagram of an electronic device 20, according to an exemplary embodiment, and the contents of the diagram should not be construed as limiting the scope of use of the present application in any way.
Fig. 5 is a schematic structural diagram of an electronic device 20 according to an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input output interface 25, and a communication bus 26. Wherein the memory 22 is used for storing a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the disc automation test method disclosed in any of the foregoing embodiments.
In this embodiment, the power supply 23 is configured to provide an operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and an external device, and the communication protocol to be followed is any communication protocol applicable to the technical solution of the present application, which is not specifically limited herein; the input/output interface 25 is used for acquiring external input data or outputting external output data, and the specific interface type thereof may be selected according to the specific application requirement, which is not limited herein.
The memory 22 may be a carrier for storing resources, such as a read-only memory, a random access memory, a magnetic disk, or an optical disk, and the resources stored thereon may include an operating system 221, a computer program 222, data 223, and the like, and the storage may be temporary storage or permanent storage.
The operating system 221 is used for managing and controlling various hardware devices on the electronic device 20 and the computer program 222, so as to implement the operation and processing of the processor 21 on the mass data 223 in the memory 22, which may be Windows Server, netware, unix, linux, etc. The computer program 222 may further include a computer program that can be used to perform other specific tasks in addition to the computer program that can be used to perform the disc automated test method performed by the electronic device 20 disclosed in any of the previous embodiments. The data 223 may include smart information collected by the electronic device 20.
Further, the embodiment of the application also discloses a storage medium, wherein the storage medium stores a computer program, and when the computer program is loaded and executed by a processor, the steps of the disc automation test method disclosed in any embodiment are realized.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, so that the same or similar parts between the embodiments are referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The disc automation test method, device, equipment and storage medium provided by the invention are described in detail, and specific examples are applied to illustrate the principle and implementation of the invention, and the description of the examples is only used for helping to understand the method and core idea of the invention; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present invention, the present description should not be construed as limiting the present invention in view of the above.