CN116302766A - Fault injection testing method and device, electronic equipment and readable storage medium - Google Patents

Fault injection testing method and device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN116302766A
CN116302766A CN202211100851.4A CN202211100851A CN116302766A CN 116302766 A CN116302766 A CN 116302766A CN 202211100851 A CN202211100851 A CN 202211100851A CN 116302766 A CN116302766 A CN 116302766A
Authority
CN
China
Prior art keywords
test
fault injection
injection test
type
log data
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
CN202211100851.4A
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.)
Shandong Youren Networking Co ltd
Original Assignee
Shandong Youren Networking 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 Shandong Youren Networking Co ltd filed Critical Shandong Youren Networking Co ltd
Priority to CN202211100851.4A priority Critical patent/CN116302766A/en
Publication of CN116302766A publication Critical patent/CN116302766A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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/26Functional testing
    • 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/2205Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
    • G06F11/2236Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested to test CPU or processors
    • 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/2268Logging of test results
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3013Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system is an embedded system, i.e. a combination of hardware and software dedicated to perform a certain function in mobile devices, printers, automotive or aircraft systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3065Monitoring arrangements determined by the means or processing involved in reporting the monitored data
    • G06F11/3072Monitoring arrangements determined by the means or processing involved in reporting the monitored data where the reporting involves data filtering, e.g. pattern matching, time or event triggered, adaptive or policy-based reporting

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

The application discloses a fault injection testing method, a device, electronic equipment and a readable storage medium, which are applied to the technical field of embedded testing, wherein the fault injection testing method comprises the following steps: acquiring an imported preset test script, and determining at least one test type of fault injection test and a test sequence corresponding to the test type according to the preset test script; acquiring log data generated by tested equipment in real time; and carrying out fault injection test on the tested equipment according to the log data, the test type and the test sequence to obtain a fault injection test result and outputting the fault injection test result. The method and the device solve the technical problem that the reliability verification of the embedded product in the prior art is not comprehensive enough.

Description

Fault injection testing method and device, electronic equipment and readable storage medium
Technical Field
The present disclosure relates to the field of embedded testing technologies, and in particular, to a fault injection testing method and apparatus, an electronic device, and a readable storage medium.
Background
The fault injection test is an important test item for verifying the reliability of the embedded product, in the existing fault injection test method, multiple types of fault injection tests exist, if the reliability of the embedded product needs to be completely verified, multiple fault injection tests are needed, but at present, only a single type of fault injection test can be performed on the embedded product through a programmable logic device, and the verification of the reliability of the embedded product is not comprehensive enough.
Disclosure of Invention
The main purpose of the application is to provide a fault injection testing method, a device, an electronic device and a readable storage medium, and aims to solve the technical problem that in the prior art, the reliability verification of an embedded product is not comprehensive enough.
In order to achieve the above object, the present application provides a fault injection test method, which is applied to a fault injection test device, and the fault injection test method includes:
acquiring an imported preset test script, and determining at least one test type of fault injection test and a test sequence corresponding to the test type according to the preset test script;
acquiring log data generated by tested equipment in real time;
and carrying out fault injection test on the tested equipment according to the log data, the test type and the test sequence to obtain a fault injection test result and outputting the fault injection test result.
Optionally, the step of performing a fault injection test on the tested device according to the log data, the test type and the test sequence to obtain a fault injection test result and outputting the fault injection test result includes:
performing fault injection test of the test type corresponding to the test sequence on the tested equipment according to the log data to obtain a fault injection test result of the test type;
Determining whether to end the fault injection test according to the fault injection test result and the preset test script;
if it is determined to continue the fault injection test, then execution is returned: acquiring log data generated by tested equipment in real time;
and if the fault injection test is determined to be ended, outputting a fault injection test result.
Optionally, the step of performing fault injection test on the tested device according to the log data, the test type and the test sequence to obtain a fault injection test result includes:
determining the execution condition of fault injection test of each test type;
detecting whether the log data meets the execution condition;
and if the log data meets the execution conditions, sequentially executing fault injection tests of the test types on the tested equipment according to the test sequence to obtain a fault injection test result.
Optionally, the step of sequentially performing fault injection tests of each test type on the tested device according to the test sequence to obtain a fault injection test result includes:
acquiring the test type of the fault injection test according to the test sequence;
Determining the test times of the fault injection test of the test type;
executing fault injection test of the test times on the tested equipment, and determining the success times, the abnormal times and the corresponding abnormal contents of the fault injection test;
and taking the success times, the abnormal times and the abnormal content as fault injection test results.
Optionally, the step of determining whether to end the fault injection test according to the fault injection test result and the preset test script includes:
if the fault injection test result is determined to be in accordance with the preset abnormal type, ending the fault injection test;
and if the fault injection test of each test type is determined to be completed according to the preset test script, ending the fault injection test.
Optionally, after the step of acquiring log data generated by the tested device in real time, the method further includes:
detecting whether the tested equipment fails according to the log data;
and if the tested equipment faults are detected, ending the fault injection test, and outputting the obtained fault injection test result.
Optionally, before the step of acquiring the imported preset test script, the method further includes:
Acquiring the input test type and test sequence of the fault injection test;
and constructing a preset test script according to the test type and the test sequence.
To achieve the above object, the present application further provides a fault injection test device, which is applied to a fault injection test apparatus, the fault injection test device including:
the acquisition script module is used for acquiring an imported preset test script, and determining at least one test type of fault injection test and a test sequence corresponding to the test type according to the preset test script;
the log acquisition module is used for acquiring log data generated by the tested equipment in real time;
and the test result module is used for carrying out fault injection test on the tested equipment according to the log data, the test type and the test sequence to obtain a fault injection test result and outputting the fault injection test result.
Optionally, the test result module is further configured to:
performing fault injection test of the test type corresponding to the test sequence on the tested equipment according to the log data to obtain a fault injection test result of the test type;
Determining whether to end the fault injection test according to the fault injection test result and the preset test script;
if it is determined to continue the fault injection test, then execution is returned: acquiring log data generated by tested equipment in real time;
and if the fault injection test is determined to be ended, outputting a fault injection test result.
Optionally, the test result module is further configured to:
determining the execution condition of fault injection test of each test type;
detecting whether the log data meets the execution condition;
and if the log data meets the execution conditions, sequentially executing fault injection tests of the test types on the tested equipment according to the test sequence to obtain a fault injection test result.
Optionally, the test result module is further configured to:
acquiring the test type of the fault injection test according to the test sequence;
determining the test times of the fault injection test of the test type;
executing fault injection test of the test times on the tested equipment, and determining the success times, the abnormal times and the corresponding abnormal contents of the fault injection test;
and taking the success times, the abnormal times and the abnormal content as fault injection test results.
Optionally, the test result module is further configured to:
if the fault injection test result is determined to be in accordance with the preset abnormal type, ending the fault injection test;
and if the fault injection test of each test type is determined to be completed according to the preset test script, ending the fault injection test.
Optionally, the fault injection testing device is further configured to:
detecting whether the tested equipment fails according to the log data;
and if the tested equipment faults are detected, ending the fault injection test, and outputting the obtained fault injection test result.
Optionally, the fault injection testing device is further configured to:
acquiring the input test type and test sequence of the fault injection test;
and constructing a preset test script according to the test type and the test sequence.
The application also provides an electronic device comprising: the fault injection test system comprises a memory, a processor and a program of the fault injection test method stored on the memory and capable of running on the processor, wherein the program of the fault injection test method can realize the steps of the fault injection test method when being executed by the processor.
The present application also provides a readable storage medium, where the readable storage medium is a computer readable storage medium, and a program for implementing a fault injection test method is stored on the computer readable storage medium, where the program for implementing the fault injection test method implements the steps of the fault injection test method as described above when executed by a processor.
The present application also provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of the fault injection testing method as described above.
The application provides a fault injection test method, electronic equipment and a readable storage medium, namely, an imported preset test script is obtained, and a test type of at least one fault injection test and a test sequence corresponding to the test type are determined according to the preset test script; acquiring log data generated by tested equipment in real time; according to the log data, the test types and the test sequence, fault injection test is carried out on the tested equipment, a fault injection test result is obtained, and the fault injection test result is output, so that sequential multi-type fault injection test is carried out on the tested equipment, the defect that the conventional fault injection test can only be carried out in a single mode and a single mode is overcome, the test efficiency is greatly improved, meanwhile, the comprehensiveness of reliability verification of an embedded product is improved, and meanwhile, through real-time detection of the log data, the real-time performance of the reliability verification is improved according to the real-time state of the equipment recorded in the log data.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the description of the embodiments or the prior art will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a schematic flow chart of a first embodiment of a fault injection testing method according to the present application;
FIG. 2 is a schematic diagram of a fault injection test system according to the present application;
FIG. 3 is a flow chart of a second embodiment of the fault injection testing method of the present application;
FIG. 4 is a schematic diagram of the structural relationship of the fault injection testing device of the present application;
fig. 5 is a schematic device structure diagram of a hardware operating environment related to a fault injection testing method in an embodiment of the present application.
The implementation, functional features and advantages of the present application will be further described with reference to the accompanying drawings in conjunction with the embodiments.
Detailed Description
In order to make the above objects, features and advantages of the present invention more comprehensible, the following description of the embodiments accompanied with the accompanying drawings will be given in detail. It will be apparent that the described embodiments are only some, but not all, embodiments of the invention. 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.
Example 1
An embodiment of the present application provides a fault injection testing method, in a first embodiment of the fault injection testing method of the present application, referring to fig. 1, the fault injection testing method includes:
step S10, acquiring an imported preset test script, and determining at least one test type of fault injection test and a test sequence corresponding to the test type according to the preset test script;
step S20, acquiring log data generated by tested equipment in real time;
and step S30, performing fault injection test on the tested equipment according to the log data, the test type and the test sequence to obtain a fault injection test result and outputting the fault injection test result.
In this embodiment, it should be noted that, as shown in fig. 2, the system structure of the present application includes a PC host computer for acquiring an imported preset test script, a device under test and an auxiliary test board, where the device under test is connected to the auxiliary test board, the device under test is connected to the PC host computer through a log port, A, B, C represents several test types of functional modules for fault implantation test, and the host computer can detect a device state by reading log data of the device under test and control the auxiliary test board to perform fault implantation.
The method comprises the steps that a preset test script integrates scripts of various test types for a user, functional modules of various fault injection tests are inherited on the same system through preset test configuration and preset test types on an auxiliary test board, the test types at least comprise abnormal power failure, abnormal parameter reading and writing processes, abnormal network and the like, the processes of each fault injection test are different, the corresponding test sequence and test times can be edited for various test types to be performed according to the configuration of the preset test script, accordingly, the fault injection test to be performed on tested equipment is automatically performed, and the fault injection test results have different output formats according to different test types.
Illustratively, steps S10 through S30 include:
acquiring the input requirements of a user, automatically constructing a required preset test script according to the requirements of the user, determining the test sequence of fault injection tests of all test types according to the preset test script, simultaneously acquiring log data of real-time running of tested equipment, sequentially carrying out the fault injection tests on the tested equipment according to the recorded content of the log data, the test types and the test sequence, obtaining a fault injection test result and simultaneously outputting the fault injection test result.
Specifically, the fault injection test with abnormal power failure is to perform abnormal power failure in the starting process of the device, which may cause the problems of equipment firmware loss or parameter loss, so that the power failure time is divided into three stages in the test process: boot loading phase, parameter loading phase and random power-off. In a specific embodiment, the device under test is connected to a power supply through an auxiliary test board; the PC upper computer is connected with a log port of the equipment through a serial port line, and log data is read, so that the time for reaching each stage is obtained; since the log data printing information of different devices is inconsistent, determining the log data in a script mode is adopted; the upper computer determines log data in the equipment starting process through an imported preset test script, monitors log port information, and controls the auxiliary test board card to perform power-off operation when boot loading mark information is found; after 5s of power-off interval, recovering the power supply, and continuing the test of the next stage; the upper computer monitors log marks loaded by parameters, and controls the auxiliary measuring board card to perform power-off operation after the log marks are monitored; after 5s of power-off interval, recovering the power supply, and continuing the test of the next stage; finally, power off is carried out for random time, and the random maximum and minimum time can be set; and if the upper computer cannot receive correct log data within 5 seconds after the upper computer is electrified again, the upper computer is powered off for retry, retries for 3 times, and if the upper computer is abnormal, the tested equipment is judged to have unrecoverable abnormality, and the test is terminated.
Specifically, the test type is that the fault injection test of the abnormal parameter reading and writing process is abnormal power-off in the parameter writing process of the equipment, so that the problems of equipment firmware loss or parameter loss and the like are easily caused, but in the conventional test, the AT instruction is set to be faster in writing parameters and incapable of manually power-off, so that the test is realized by means of software and an auxiliary test board card. In a specific embodiment, the tested equipment is connected with a power supply through an auxiliary testing board card, and a serial port and a log port of the tested equipment are connected with a PC upper computer; the upper computer carries out parameter configuration on the tested equipment through a preset test script, configures at least 5 parameters, and ensures that the subsequent test cannot be changed and is inconsistent with the factory parameters; the upper computer uses the AT instruction to set parameters and inquire parameters of the equipment through the serial port, the content of the AT instruction is not limited, but the AT instruction must contain instructions for parameter preservation, such as AT+S, AT+Z, and the like; after the command is sent for 10ms, before the OK is replied, the auxiliary measurement board card is controlled to be powered off; after 5s of power failure, the power is turned on again, and whether the set parameters are normal is inquired.
Specifically, the fault injection test with the test type of network abnormality comprises Ethernet network on-off abnormality and cellular network on-off abnormality. In a specific embodiment, the step of switching on and switching off the Ethernet network is that a network port of the equipment is connected with the network through an auxiliary measurement board card; importing a network monitoring script and configuring test times; the PC upper computer is connected with a log port of the tested equipment through a serial port line and monitors log data; the fault implantation board is added with a network card design, and the on-off of a network is controlled through the high and low levels; the upper computer configures the test times of the fault implanted board card, monitors the networking state of the tested equipment through log in the test process, when the board card network is disconnected, the equipment network is disconnected, and when the board card network is recovered to be normal, the equipment network is in a normal state. If the device network state is unchanged after the timeout time is reached, the device network state is marked as abnormal. In a specific embodiment, the step of abnormal on-off of the cellular network is that an antenna of the cellular communication equipment is connected with the network through a fault implantation board card; the upper computer acquires log data of the equipment when the network is disconnected and the network connection is successful through importing a network monitoring script, and configures the test times; the auxiliary measuring board achieves the effect of shielding network signals through signal attenuation; in the testing process, the upper computer monitors and judges whether the networking state of the equipment is correct or not through the log data and log port information of the network on-off known by the script. When the network is abnormal, the equipment network is in a disconnected state, and when the network is recovered to be normal, the equipment network can be recovered in time. If the device network state is unchanged after the timeout time is reached, the device network state is marked as abnormal.
After step S20, the step of obtaining log data generated by the tested device in real time further includes:
step A10, detecting whether the tested equipment fails according to the log data;
and step A20, ending the fault injection test and outputting the obtained fault injection test result if the tested equipment faults are detected.
Illustratively, steps a10 through a20 include:
after the fault injection test of each test type is finished, the log data generated by the tested equipment in real time is required to be re-acquired, whether the tested equipment breaks down or not can be detected through the log data, normal operation can be continued or not, if the tested equipment breaks down, all fault injection tests of the round are directly finished, the fault injection test results obtained among the faults of the tested equipment are output, if the tested equipment does not break down, the fault injection tests of other test types are continuously executed until the tested equipment breaks down or all fault injection tests in a preset test script are completed, whether the equipment breaks down or not is determined through the log data, the state of the equipment is monitored in real time, and when the tested equipment breaks down, the test can be automatically terminated.
Before step S10, before the step of obtaining the imported preset test script, the method further includes:
step B10, acquiring the input test type and test sequence of the fault injection test;
and step B20, constructing a preset test script according to the test type and the test sequence.
Illustratively, steps B10 through B20 include:
the method comprises the steps of obtaining a test type required to be performed and a priority of each test type, namely a test sequence, which are input by a user, and automatically constructing a customized preset test script according to the test type and the test sequence, wherein an auxiliary test board comprises a plurality of fault injection functional modules and configuration information, and after the upper computer obtains the requirements of the user, the auxiliary test board automatically generates preset test parameters meeting the requirements according to the configuration information so as to perform customized fault injection test.
The embodiment of the application provides a fault injection testing method, namely, an imported preset testing script is obtained, and at least one test type of fault injection testing and a testing sequence corresponding to the test type are determined according to the preset testing script; acquiring log data generated by tested equipment in real time; according to the log data, the test types and the test sequence, fault injection test is carried out on the tested equipment, a fault injection test result is obtained, and the fault injection test result is output, so that sequential multi-type fault injection test is carried out on the tested equipment, the defect that the conventional fault injection test can only be carried out in a single mode and a single mode is overcome, the test efficiency is greatly improved, meanwhile, the comprehensiveness of reliability verification of an embedded product is improved, and meanwhile, through real-time detection of the log data, the real-time performance of the reliability verification is improved according to the real-time state of the equipment recorded in the log data.
Example two
Further, referring to fig. 3, in another embodiment of the present application, the same or similar content as the first embodiment may be referred to the description above, and will not be repeated herein. On this basis, in step S30, the step of performing a fault injection test on the tested device according to the log data, the test type and the test sequence to obtain a fault injection test result and outputting the fault injection test result includes:
step C10, performing fault injection test of the test type corresponding to the test sequence on the tested equipment according to the log data to obtain a fault injection test result of the test type;
step C20, determining whether to end the fault injection test according to the fault injection test result and the preset test script;
step C30, if it is determined to continue the fault injection test, returning to execute: acquiring log data generated by tested equipment in real time;
and step C40, outputting the fault injection test result if the fault injection test is determined to be ended.
In this embodiment, it should be noted that, the log data is log information generated in real time by the tested device, and according to the log data, the state of the tested device may be monitored in real time, where the test types at least include abnormal power failure, abnormal parameter reading and writing processes, abnormal network, etc., each fault injection test process has a difference, according to the configuration of a preset test script, the corresponding test sequence and test times may be edited for each test type to be performed, so that the fault injection test to be performed on the tested device is automatically performed, the test result has different output formats according to different test types, and the test sequence may also be the priority of the fault injection test of each test type, where when the fault injection test result is an unrecoverable abnormality, the fault injection test is ended, and when the operation of the preset test script is completed, the fault injection test is ended.
The steps C10 to C40 include:
determining the test type of the fault injection test to be performed currently according to the test sequence in the preset test script, executing the fault injection test according to the real-time log data to obtain a fault injection test result, determining whether to end the fault injection test according to the fault injection test result and the execution of the preset test script, and if the fault injection test is determined to be continued, returning to execute: and acquiring log data generated by tested equipment in real time, then executing fault injection test to be performed next according to the test sequence, and if the fault injection test is determined to be finished, outputting the obtained fault injection test result directly in a preset result format of each test type.
In step C10, the step of performing a fault injection test on the tested device according to the log data, the test type and the test sequence to obtain a fault injection test result includes:
step C11, determining the execution condition of fault injection test of each test type;
step C12, detecting whether the log data meets the execution condition;
and step C13, if the log data is determined to meet the execution conditions, sequentially executing fault injection tests of the test types on the tested equipment according to the test sequence to obtain a fault injection test result.
In this embodiment, it should be noted that, the execution conditions are preset in advance for the fault implantation tests of different test types, and the fault implantation test can be continuously executed only if the execution conditions are satisfied, if the execution conditions are not satisfied, the current fault implantation test progress is paused, and the execution conditions need to be waited for to be satisfied and then continued.
Illustratively, steps C11 through C13 include:
determining execution conditions of fault injection tests of all test types according to a preset test script, judging whether the tested equipment meets the execution conditions by detecting real-time log data, if so, sequentially executing the fault injection tests of all test types according to a test sequence to obtain a fault injection test result, and if not, continuously acquiring the real-time log data until the tested equipment meets the execution conditions, and carrying out the fault injection test according to the current state of the equipment by monitoring the log data to ensure that the real-time performance of the fault injection test is high.
In step C13, the step of sequentially performing fault injection tests of each test type on the tested device according to the test sequence to obtain a fault injection test result includes:
Step C131, obtaining the test type of the fault injection test according to the test sequence;
step C132, determining the test times of the fault injection test of the test type;
step C133, performing fault injection test of the test times on the tested equipment, and determining the success times, the abnormal times and the corresponding abnormal contents of the fault injection test;
and step C134, taking the success times, the abnormal times and the abnormal content as fault injection test results.
In this embodiment, it should be noted that the number of times of fault injection test may be preset in advance for each test type, and the number of times of success and the number of abnormal times of test may be obtained through the fault injection test, where the number of times of abnormality test may obtain abnormal content, such as abnormal execution operation, cause of abnormality, and the like.
Illustratively, steps C131 through C134 include:
determining the test type of the fault injection test according to the test sequence in the preset test script, determining the number of times of tests to be executed by the current test type, executing the fault injection test of the number of times of tests on the tested equipment, determining the success number of times of the fault injection test, the abnormal number of times and the corresponding abnormal content, and taking the success number of times, the abnormal number of times and the abnormal content as fault injection test results.
In step C20, the step of determining whether to end the fault injection test according to the fault injection test result and the preset test script includes:
step C21, if the fault injection test result is determined to be in accordance with a preset abnormal type, ending the fault injection test;
and step C22, if the fault injection test of each test type is determined to be completed according to the preset test script, ending the fault injection test.
In this embodiment, it should be noted that the preset exception type is an unrecoverable exception type in the fault injection test.
Illustratively, steps C21 through C22 include:
if the fault injection test result is determined to be in accordance with the preset abnormal type, ending the fault injection test, and if the fault injection test of each test type is determined to be completed according to the preset test script, ending the fault injection test.
The embodiment of the application provides a fault injection test method, namely, fault injection test is carried out on tested equipment according to the log data, the test type and the test sequence, so as to obtain a fault injection test result; determining whether to end the fault injection test according to the fault injection test result and the preset test script; if it is determined to continue the fault injection test, then execution is returned: acquiring log data generated by tested equipment in real time; and if the fault injection test is determined to be ended, outputting a fault injection test result. The automatic test is executed according to the test sequence set by the upper computer, after the execution of one test item is completed, whether the next test item is tested is determined according to the execution result of the last test item, if the equipment fails to recover, the test is terminated, and under other conditions, the test of the next test item is continued, and a single test item or a plurality of test items can be selected for continuous execution, so that the full-automatic test is realized.
Example III
The embodiment of the application also provides a fault injection testing device, which is applied to fault injection testing equipment and comprises:
the acquisition script module D10 is used for acquiring an imported preset test script, and determining at least one test type of fault injection test and a test sequence corresponding to the test type according to the preset test script;
the log acquisition module D20 is used for acquiring log data generated by the tested equipment in real time;
and the test result module D30 is used for carrying out fault injection test on the tested equipment according to the log data, the test type and the test sequence to obtain a fault injection test result and outputting the fault injection test result.
Optionally, the test result module D30 is further configured to:
performing fault injection test of the test type corresponding to the test sequence on the tested equipment according to the log data to obtain a fault injection test result of the test type;
determining whether to end the fault injection test according to the fault injection test result and the preset test script;
if it is determined to continue the fault injection test, then execution is returned: acquiring log data generated by tested equipment in real time;
And if the fault injection test is determined to be ended, outputting a fault injection test result.
Optionally, the test result module D30 is further configured to:
determining the execution condition of fault injection test of each test type;
detecting whether the log data meets the execution condition;
and if the log data meets the execution conditions, sequentially executing fault injection tests of the test types on the tested equipment according to the test sequence to obtain a fault injection test result.
Optionally, the test result module D30 is further configured to:
acquiring the test type of the fault injection test according to the test sequence;
determining the test times of the fault injection test of the test type;
executing fault injection test of the test times on the tested equipment, and determining the success times, the abnormal times and the corresponding abnormal contents of the fault injection test;
and taking the success times, the abnormal times and the abnormal content as fault injection test results.
Optionally, the test result module D30 is further configured to:
if the fault injection test result is determined to be in accordance with the preset abnormal type, ending the fault injection test;
And if the fault injection test of each test type is determined to be completed according to the preset test script, ending the fault injection test.
Optionally, the fault injection testing device is further configured to:
detecting whether the tested equipment fails according to the log data;
and if the tested equipment faults are detected, ending the fault injection test, and outputting the obtained fault injection test result.
Optionally, the fault injection testing device is further configured to:
acquiring the input test type and test sequence of the fault injection test;
and constructing a preset test script according to the test type and the test sequence.
The fault injection testing device provided by the invention adopts the fault injection testing method in the first embodiment or the second embodiment, and solves the technical problem that the reliability verification of the embedded product is not comprehensive enough. Compared with the prior art, the fault injection testing device provided by the embodiment of the invention has the same beneficial effects as the fault injection testing method provided by the embodiment, and other technical features in the fault injection testing device are the same as the features disclosed by the method of the embodiment, and are not repeated herein.
Example IV
The embodiment of the invention provides electronic equipment, which comprises: at least one processor; and a memory communicatively coupled to the at least one processor; the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can execute the fault injection test method in the first embodiment.
Referring now to fig. 5, a schematic diagram of an electronic device suitable for use in implementing embodiments of the present disclosure is shown. The electronic devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 5 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 5, the electronic apparatus E90 may include a processing device E10 (e.g., a central processing unit, a graphic processor, etc.) that may perform various appropriate actions and processes according to a program stored in a read only memory E20 (ROM) or a program loaded from a storage device into a random access memory E30 (RAM). In the frame 30, various programs and data required for the operation of the electronic device are also stored. The processing devices E10, ROME20, and RAME30 are connected to each other by a bus. An input/output E40 (I/O) interface is also connected to the bus.
In general, the following systems may be connected to I/O interface E40: input devices E50 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device E60 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, etc.; storage means E70 including, for example, magnetic tape, hard disk, etc.; communication device E80. The communication means E80 may allow the electronic device E90 to communicate with other devices wirelessly or by wire to exchange data. While electronic devices having various systems are shown in the figures, it should be understood that not all of the illustrated systems are required to be implemented or provided. More or fewer systems may alternatively be implemented or provided.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from the network via a communication device, or installed from the storage device E70, or installed from the romie 20. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by a processing device.
The electronic equipment provided by the invention adopts the fault injection testing method in the first embodiment or the second embodiment, and solves the technical problem that the reliability verification of the embedded product is not comprehensive enough. Compared with the prior art, the beneficial effects of the electronic device provided by the embodiment of the invention are the same as those of the fault injection testing method provided by the first embodiment, and other technical features of the electronic device are the same as those disclosed by the method of the first embodiment, so that the description is omitted herein.
It should be understood that portions of the present disclosure may be implemented in hardware, software, firmware, or a combination thereof. In the description of the above embodiments, particular features, structures, materials, or characteristics may be combined in any suitable manner in any one or more embodiments or examples.
The foregoing is merely illustrative of the present invention, and the present invention is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Example five
The present embodiment provides a computer readable storage medium having computer readable program instructions stored thereon for performing the method of fault injection testing in the first embodiment described above.
The computer readable storage medium according to the embodiments of the present invention may be, for example, a usb disk, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this embodiment, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, or device. Program code embodied on a computer readable storage medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
The above-described computer-readable storage medium may be contained in an electronic device; or may exist alone without being assembled into an electronic device.
The computer-readable storage medium carries one or more programs that, when executed by an electronic device, cause the electronic device to: acquiring an imported preset test script, and determining at least one test type of fault injection test and a test sequence corresponding to the test type according to the preset test script; acquiring log data generated by tested equipment in real time; and carrying out fault injection test on the tested equipment according to the log data, the test type and the test sequence to obtain a fault injection test result and outputting the fault injection test result.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present disclosure may be implemented in software or hardware. Wherein the name of the module does not constitute a limitation of the unit itself in some cases.
The computer readable storage medium provided by the invention stores the computer readable program instructions for executing the fault injection test method, and solves the technical problem that the reliability verification of the embedded product is not comprehensive enough. Compared with the prior art, the beneficial effects of the computer readable storage medium provided by the embodiment of the present invention are the same as those of the fault injection testing method provided by the first embodiment or the second embodiment, and are not described herein.
Example six
The present application also provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of the fault injection testing method as described above.
The computer program product solves the technical problem that the reliability verification of the embedded product is not comprehensive enough. Compared with the prior art, the beneficial effects of the computer program product provided by the embodiment of the present invention are the same as those of the fault injection testing method provided by the first embodiment or the second embodiment, and are not described herein.
The foregoing description is only of the preferred embodiments of the present application and is not intended to limit the scope of the claims, and all equivalent structures or equivalent processes using the descriptions and drawings of the present application, or direct or indirect application in other related technical fields are included in the scope of the claims.

Claims (10)

1. A fault injection testing method, characterized in that the fault injection testing method comprises:
acquiring an imported preset test script, and determining at least one test type of fault injection test and a test sequence corresponding to the test type according to the preset test script;
acquiring log data generated by tested equipment in real time;
and carrying out fault injection test on the tested equipment according to the log data, the test type and the test sequence to obtain a fault injection test result and outputting the fault injection test result.
2. The fault injection test method as claimed in claim 1, wherein the step of performing fault injection test on the device under test according to the log data, the test type and the test sequence to obtain a fault injection test result and outputting the fault injection test result comprises:
performing fault injection test of the test type corresponding to the test sequence on the tested equipment according to the log data to obtain a fault injection test result of the test type;
determining whether to end the fault injection test according to the fault injection test result and the preset test script;
If it is determined to continue the fault injection test, then execution is returned: acquiring log data generated by tested equipment in real time;
and if the fault injection test is determined to be ended, outputting a fault injection test result.
3. The fault injection test method according to claim 2, wherein the step of performing fault injection test of the test type corresponding to the test sequence on the tested device according to the log data to obtain a fault injection test result of the test type includes:
determining the execution condition of fault injection test of each test type;
detecting whether the log data meets the execution condition;
and if the log data meets the execution conditions, sequentially executing fault injection tests of the test types on the tested equipment according to the test sequence to obtain a fault injection test result.
4. The fault injection test method as claimed in claim 3, wherein the step of sequentially performing fault injection tests of each of the test types on the device under test according to the test sequence to obtain a fault injection test result comprises:
acquiring the test type of the fault injection test according to the test sequence;
Determining the test times of the fault injection test of the test type;
executing fault injection test of the test times on the tested equipment, and determining the success times, the abnormal times and the corresponding abnormal contents of the fault injection test;
and taking the success times, the abnormal times and the abnormal content as fault injection test results.
5. The fault injection test method as claimed in claim 2, wherein the step of determining whether to end the fault injection test according to the fault injection test result and the preset test script comprises:
if the fault injection test result is determined to be in accordance with the preset abnormal type, ending the fault injection test;
and if the fault injection test of each test type is determined to be completed according to the preset test script, ending the fault injection test.
6. The fault injection testing method of claim 1, wherein after the step of obtaining log data generated in real time by the device under test, further comprising:
detecting whether the tested equipment fails according to the log data;
and if the tested equipment faults are detected, ending the fault injection test, and outputting the obtained fault injection test result.
7. The fault injection testing method of claim 1, further comprising, prior to the step of obtaining the imported preset test script:
acquiring the input test type and test sequence of the fault injection test;
and constructing a preset test script according to the test type and the test sequence.
8. A fault injection testing device, the fault injection testing device comprising:
the acquisition script module is used for acquiring an imported preset test script, and determining at least one test type of fault injection test and a test sequence corresponding to the test type according to the preset test script;
the log acquisition module is used for acquiring log data generated by the tested equipment in real time;
and the test result module is used for carrying out fault injection test on the tested equipment according to the log data, the test type and the test sequence to obtain a fault injection test result and outputting the fault injection test result.
9. An electronic device, the electronic device comprising:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein,,
The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the steps of the fault injection testing method of any one of claims 1 to 7.
10. A readable storage medium, characterized in that it has stored thereon a program for realizing the fault injection test method, which is executed by a processor to realize the steps of the fault injection test method according to any one of claims 1 to 7.
CN202211100851.4A 2022-09-09 2022-09-09 Fault injection testing method and device, electronic equipment and readable storage medium Pending CN116302766A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211100851.4A CN116302766A (en) 2022-09-09 2022-09-09 Fault injection testing method and device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211100851.4A CN116302766A (en) 2022-09-09 2022-09-09 Fault injection testing method and device, electronic equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN116302766A true CN116302766A (en) 2023-06-23

Family

ID=86819134

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211100851.4A Pending CN116302766A (en) 2022-09-09 2022-09-09 Fault injection testing method and device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN116302766A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117130945A (en) * 2023-10-26 2023-11-28 中国证券登记结算有限责任公司 Test method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117130945A (en) * 2023-10-26 2023-11-28 中国证券登记结算有限责任公司 Test method and device
CN117130945B (en) * 2023-10-26 2024-02-09 中国证券登记结算有限责任公司 Test method and device

Similar Documents

Publication Publication Date Title
CN107463500B (en) Debugging method, medium, system and computing device of test script
US9323648B2 (en) Automatic testing apparatus for embedded software and automatic testing method thereof
US20190227917A1 (en) Adaptive system for mobile device testing
CN106331975B (en) Fault detection method, device and system for intelligent voice interaction equipment
CN105094903A (en) Method and device for upgrading firmware
CN104063305A (en) Pressure testing method, device and system for intelligent terminal software
CN110989926B (en) Fault magnetic disc slot positioning method and device and electronic equipment
CN110716853A (en) Test script recording method, application program testing method and related device
CN110377341B (en) Method, device, medium and electronic equipment for monitoring no-response exception
CN108874441B (en) Board card configuration method, device, server and storage medium
CN113077834A (en) Storage device testing method and device, television and storage medium
CN116302766A (en) Fault injection testing method and device, electronic equipment and readable storage medium
KR20140046121A (en) System and method for testing application
CN110825595B (en) Recording playback method and system, storage medium
CN110532203B (en) NAND reset method, device, electronic equipment and storage medium
CN114443442B (en) Log storage method and electronic equipment
CN111475423A (en) Data entry method and device, electronic equipment and readable storage medium
CN110889116A (en) Advertisement blocking method and device and electronic equipment
CN114595154A (en) Test method and device for XTS failure item, electronic equipment and storage medium
CN114968644A (en) System software dump method and device, electronic equipment and readable storage medium
CN110837467A (en) Software testing method, device and system
CN111651308B (en) Method and device for acquiring debugging data of DP-HDMI chip and intelligent device
CN108664366B (en) Data transmission method and device and server
CN113835995B (en) Method and device for generating test cases
RU2671999C1 (en) Method and system for diagnostics of mobile computer devices

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