CN114595025A - Method and device for processing automatic test task exception and electronic equipment - Google Patents
Method and device for processing automatic test task exception and electronic equipment Download PDFInfo
- Publication number
- CN114595025A CN114595025A CN202011431630.6A CN202011431630A CN114595025A CN 114595025 A CN114595025 A CN 114595025A CN 202011431630 A CN202011431630 A CN 202011431630A CN 114595025 A CN114595025 A CN 114595025A
- Authority
- CN
- China
- Prior art keywords
- test task
- abnormal
- recovery
- exception
- task
- 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
Links
- 238000012360 testing method Methods 0.000 title claims abstract description 378
- 238000012545 processing Methods 0.000 title claims abstract description 62
- 238000000034 method Methods 0.000 title claims abstract description 50
- 238000011084 recovery Methods 0.000 claims abstract description 215
- 230000002159 abnormal effect Effects 0.000 claims abstract description 210
- 238000012544 monitoring process Methods 0.000 claims abstract description 28
- 238000013515 script Methods 0.000 claims description 35
- 230000006870 function Effects 0.000 claims description 16
- 238000003672 processing method Methods 0.000 claims description 5
- 230000007246 mechanism Effects 0.000 abstract description 8
- 238000004458 analytical method Methods 0.000 description 8
- 230000008569 process Effects 0.000 description 7
- 230000005856 abnormality Effects 0.000 description 5
- 238000010586 diagram Methods 0.000 description 5
- 238000013507 mapping Methods 0.000 description 4
- 230000009286 beneficial effect Effects 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 238000010998 test method Methods 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000002708 enhancing effect Effects 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000006855 networking Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000011056 performance test Methods 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000008439 repair process Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1446—Point-in-time backing up or restoration of persistent data
- G06F11/1448—Management of the data involved in backup or backup restore
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45575—Starting, stopping, suspending or resuming virtual machine instances
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45591—Monitoring or debugging support
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45595—Network integration; Enabling network access in virtual machine instances
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Quality & Reliability (AREA)
- Computer Hardware Design (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention provides a method and a device for processing automatic test task abnormity and electronic equipment, wherein the method comprises the following steps: monitoring the execution state of a Network Function Virtualization (NFV) test task; under the condition that the execution failure of the test task is monitored, acquiring an abnormal recovery rule corresponding to the test task; and carrying out exception fault tolerance recovery processing on the test task by using the exception recovery rule. According to the embodiment of the application, the execution state of the NFV test task is monitored in real time, the abnormal recovery rule corresponding to the test task is obtained when the test task is abnormal, and the abnormal fault-tolerant recovery processing of the test task is carried out by using the abnormal recovery rule, so that the fault-tolerant mechanism of the test system is enhanced, the workload when the test task is abnormal by manual positioning can be reduced, and the test efficiency is improved.
Description
Technical Field
The present invention relates to the field of automated testing, and in particular, to a method and an apparatus for handling an exception of an automated testing task, and an electronic device.
Background
The realization of Network Function Virtualization (NFV) can effectively reduce the cost of expensive routers and switches in Network networking. By separating functions of hardware and software from abstract modes, functions of Network equipment do not depend on special hardware resources any more, flexible sharing of infrastructure resources is achieved, more and more flexible Network capabilities can be obtained, and fault risk points are increased accordingly, so that a corresponding test platform system and a corresponding test case need to be provided for complete function and performance test of Network Services (NS).
In the existing testing method of network service, a testing executive staff pertinently selects a group of test case combinations to create a testing task to perform a full-flow test, and after a testing result is successful, the network service can normally provide service to the outside, but when one or more test cases are executed in the executing process of the testing task and have errors, the whole testing flow becomes extremely complicated and consumes time and energy, and the executing efficiency is influenced due to the lack of an effective fault-tolerant self-checking recovery mechanism, especially under the scene of executing a testing task with large time consumption.
Disclosure of Invention
The invention aims to provide a method and a device for processing an exception of an automatic test task and electronic equipment, which are used for solving the problem of low efficiency of the conventional automatic test.
To achieve the above object, an embodiment of the present invention provides a method for processing an exception of an automated test task, including:
monitoring the execution state of a Network Function Virtualization (NFV) test task;
under the condition that the execution failure of the test task is monitored, acquiring an abnormal recovery rule corresponding to the test task;
and performing exception fault tolerance recovery processing on the test task by using the exception recovery rule.
Optionally, the obtaining an abnormal recovery rule corresponding to the test task when it is monitored that the test task fails to be executed includes:
when the test task execution failure is monitored, generating an abnormal task recovery message;
acquiring an abnormal recovery rule corresponding to the test task according to the abnormal task recovery message;
wherein the exception task recovery message comprises: abnormal information of the test task execution failure and/or an identification code of the test task.
Optionally, in the case that it is monitored that the test task fails to be executed, the method further includes:
and obtaining abnormal information of the execution failure of the test task by the test task execution log.
Optionally, the obtaining, according to the abnormal task recovery message, an abnormal recovery rule corresponding to the test task includes:
according to the abnormal information of the test task execution failure, at least one abnormal recovery rule corresponding to the abnormal information is matched in an abnormal rule base; or
And matching at least one abnormal recovery rule corresponding to the identification code in an abnormal rule base according to the identification code of the test task.
Optionally, the performing, by using the exception recovery rule, an exception fault tolerance recovery process on the test task includes:
analyzing the abnormal recovery rule according to a preset execution sequence according to the matching degree of the at least one abnormal recovery rule and the test task to obtain a rule script;
and carrying out fault-tolerant recovery processing according to the rule script.
Optionally, the method further comprises:
and generating prompt information under the condition that the abnormal recovery rule corresponding to the test task is not matched or fault-tolerant recovery processing fails according to the rule script.
Optionally, in the case that it is monitored that the test task fails to be executed, the method further includes:
and carrying out abnormal fault-tolerant backup on the test task.
Optionally, the performing an abnormal fault-tolerant backup on the test task includes:
and backing up the execution state of the test case in the test task and the relevant information of the test case as a snapshot.
Optionally, after performing exception fault tolerant recovery processing on the test task by using the exception recovery rule, the method further includes:
and sending a notification message for continuing to execute the test task.
Optionally, the method further comprises:
and stopping monitoring the test task under the condition that the test task is successfully executed.
To achieve the above object, an embodiment of the present invention provides an apparatus for automatically processing a test task exception, including:
the monitoring module is used for monitoring the execution state of the Network Function Virtualization (NFV) test task;
the first acquisition module is used for acquiring an abnormal recovery rule corresponding to the test task under the condition that the execution failure of the test task is monitored;
and the first processing module is used for performing exception fault-tolerant recovery processing on the test task by using the exception recovery rule.
Optionally, the first obtaining module includes:
the message generating unit is used for generating an abnormal task recovery message when the test task execution failure is monitored;
a first obtaining unit, configured to obtain, according to the abnormal task recovery message, an abnormal recovery rule corresponding to the test task;
wherein the exception task recovery message comprises: exception information of the test task execution failure, and/or an identification code of the test task.
Optionally, the apparatus further comprises:
and the second acquisition module is used for acquiring the abnormal information of the execution failure of the test task from the test task execution log.
Optionally, the first obtaining unit is specifically configured to:
according to the abnormal information of the test task execution failure, at least one abnormal recovery rule corresponding to the abnormal information is matched in an abnormal rule base; or
And matching at least one abnormal recovery rule corresponding to the identification code in an abnormal rule base according to the identification code of the test task.
Optionally, the first processing module includes:
the analysis unit is used for analyzing the abnormal recovery rule according to a preset execution sequence according to the matching degree of the at least one abnormal recovery rule and the test task to obtain a rule script;
and the processing unit is used for carrying out fault-tolerant recovery processing according to the rule script.
Optionally, the apparatus further comprises:
and the prompt module is used for generating prompt information under the condition that the abnormal recovery rule corresponding to the test task is not matched or fault-tolerant recovery processing fails according to the rule script.
Optionally, the apparatus further comprises:
and the backup module is used for carrying out abnormal fault-tolerant backup on the test task.
Optionally, the backup module is specifically configured to: and backing up the execution state of the test case in the test task and the relevant information of the test case as a snapshot.
Optionally, the apparatus further comprises:
and the first sending module is used for sending a notification message for continuously executing the test task.
Optionally, the apparatus further comprises:
and the second processing module is used for stopping monitoring the test task under the condition that the test task is successfully executed.
To achieve the above object, an embodiment of the present invention provides an electronic device, including a processor and a transceiver, wherein,
the processor is configured to: monitoring the execution state of a Network Function Virtualization (NFV) test task;
the transceiver is to: under the condition that the execution failure of the test task is monitored, acquiring an abnormal recovery rule corresponding to the test task;
the processor is further configured to: and carrying out exception fault tolerance recovery processing on the test task by using the exception recovery rule.
Optionally, when the transceiver acquires the abnormal recovery rule corresponding to the test task under the condition that it is monitored that the test task fails to be executed, the processor is configured to: when the test task execution failure is monitored, generating an abnormal task recovery message;
the transceiver is used for acquiring an abnormal recovery rule corresponding to the test task according to the abnormal task recovery message;
wherein the exception task recovery message comprises: exception information of the test task execution failure, and/or an identification code of the test task.
Optionally, in a case that it is monitored that the test task fails to be executed, the transceiver is further configured to: and obtaining abnormal information of the execution failure of the test task by the test task execution log.
Optionally, when the transceiver acquires the abnormal recovery rule corresponding to the test task according to the abnormal task recovery message, the transceiver is specifically configured to:
according to the abnormal information of the test task execution failure, matching at least one abnormal recovery rule corresponding to the abnormal information in an abnormal rule base; or
And matching at least one abnormal recovery rule corresponding to the identification code in an abnormal rule base according to the identification code of the test task.
Optionally, when the processor performs the exception fault tolerance recovery processing on the test task by using the exception recovery rule, the processor is specifically configured to:
analyzing the abnormal recovery rule according to a preset execution sequence according to the matching degree of the at least one abnormal recovery rule and the test task to obtain a rule script;
and carrying out fault-tolerant recovery processing according to the rule script.
Optionally, the processor is further configured to: and generating prompt information under the condition that the abnormal recovery rule corresponding to the test task is not matched or fault-tolerant recovery processing fails according to the rule script.
Optionally, the processor is further configured to: and carrying out abnormal fault-tolerant backup on the test task.
Optionally, when the processor performs an abnormal fault-tolerant backup on the test task, the processor is specifically configured to: and backing up the execution state of the test case in the test task and the relevant information of the test case as a snapshot.
Optionally, after performing an exception fault tolerant recovery process on the test task by using the exception recovery rule, the transceiver is further configured to: and sending a notification message for continuing to execute the test task.
Optionally, the processor is further configured to: and stopping monitoring the test task under the condition that the test task is successfully executed.
To achieve the above object, an embodiment of the present invention provides an electronic device, which includes a transceiver, a processor, a memory, and a program or instructions stored in the memory and executable on the processor; the processor realizes the processing method of the automatic test task exception when executing the program or the instruction.
To achieve the above object, an embodiment of the present invention provides a readable storage medium, on which a program or instructions are stored, and the program or instructions, when executed by a processor, implement the steps in the processing method for automatic test task exception as described above.
The technical scheme of the invention has the following beneficial effects:
according to the embodiment of the application, the execution state of the NFV test task is monitored in real time, the abnormal recovery rule corresponding to the test task is obtained when the test task is abnormal, and the abnormal fault-tolerant recovery processing of the test task is carried out by using the abnormal recovery rule, so that the fault-tolerant mechanism of the test system is enhanced, the workload when the abnormal fault is positioned manually can be reduced, and the test efficiency is improved.
Drawings
Fig. 1 is a schematic test flow diagram of an NFV test platform according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a method for handling an exception of an automated test task according to an embodiment of the present invention;
FIG. 3 is a schematic flow chart of anomaly monitoring according to an embodiment of the present invention;
FIG. 4 is a diagram of an exception rule base according to an embodiment of the present invention;
FIG. 5 is a flowchart illustrating exception resolution according to an embodiment of the present invention;
FIG. 6 is a flowchart illustrating a test task execution exception monitoring and recovery process according to an embodiment of the present invention;
FIG. 7 is a schematic structural diagram of an apparatus for handling exceptions in an automated test task according to an embodiment of the present invention;
FIG. 8 is a schematic structural diagram of an electronic device according to an embodiment of the invention;
fig. 9 is a second schematic structural diagram of an electronic device according to an embodiment of the invention.
Detailed Description
To make the technical problems, technical solutions and advantages of the present invention more apparent, the following detailed description is given with reference to the accompanying drawings and specific embodiments.
It should be appreciated that reference throughout this specification to "one embodiment" or "an embodiment" means that a particular feature, structure or characteristic described in connection with the embodiment is included in at least one embodiment of the present invention. Thus, the appearances of the phrases "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
In various embodiments of the present invention, it should be understood that the sequence numbers of the following processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
In addition, the terms "system" and "network" are often used interchangeably herein.
In the embodiments provided herein, it should be understood that "B corresponding to a" means that B is associated with a from which B can be determined. It should also be understood that determining B from a does not mean determining B from a alone, but may also be determined from a and/or other information.
Before describing an embodiment of the method for handling an exception to an automated test task according to the present application, an NFV test platform will be described first.
As shown in FIG. 1, three components of an exception monitor, an exception rule base and an exception resolver are added to an NFV testing platform. Before a test task is initiated, firstly implanting part of commonly used abnormality detection rules into an abnormality rule library, and introducing a test case into a case resource library through a loader; the test executive personnel triggers the scheduling executor to execute the test task; step (1): when the abnormity monitor monitors that the execution result of the test task is failure, the abnormity monitor can automatically backup the execution states of all test cases and case related information in the current test task; step (2): the abnormity monitor simultaneously informs the scheduling actuator to pull up the abnormity resolver; and (3): the scheduling executor informs an exception analyzer to perform exception analysis; and the abnormal analyzer matches the corresponding abnormal recovery rule in the abnormal rule base according to the specific abnormal information.
When the abnormal resolver is not matched with the abnormal recovery rule or the abnormal resolver executes the recovery rule and has an error, the scheduling executor automatically suspends the current test task, notifies a test executor to analyze abnormal information and starts the recovery operation again after adding a new error rule into the abnormal rule base; and (4): after the rule script corresponding to the abnormal recovery rule is called to repair the abnormality, the abnormal analyzer informs the scheduling executor of abnormal recovery; and (5): after the abnormal recovery, the scheduling executor automatically pulls up the backup snapshot to continue executing the test task, thereby enhancing the fault-tolerant mechanism of the test system and improving the test efficiency. In the success, if the anomaly monitor monitors that the test task is successfully executed according to the test task execution result, the execution result is archived, and the execution result can be displayed on a page.
The following describes a specific implementation process of the method for handling an exception of an automated test task according to the embodiment of the present application.
As shown in fig. 2, a method for processing an exception of an automatic test task according to an embodiment of the present invention includes:
In this embodiment, an exception monitor may be added to the NFV test platform to monitor the task state of the NFV test task in real time after the test task is started. The monitoring of the test task can be performed based on a use case execution state and a test task execution log included in the test task.
And the exception recovery rule is used for recovering the test task which fails to be executed. The exception recovery rule can be stored in an exception rule base, and after the test task is established, the exception recovery rule commonly used by the test task can be initialized according to the test task and the prior experience. When the execution of the test task fails, an exception recovery rule corresponding to the exception information may be obtained according to the specific exception information of the test failure, for example: the test task A fails to execute, abnormal information such as error codes and detailed error information of the test task can be obtained according to an execution log of the test task A, an abnormal recovery rule corresponding to the task failure can be searched according to the contents of the error codes and the error information, and data, parameters and the like which need to be adjusted aiming at the test task failure can be included in the abnormal recovery rule.
And 203, performing exception fault tolerance recovery processing on the test task by using the exception recovery rule.
As an optional implementation manner, an exception parser may be set in the NFV test platform, where the exception parser may obtain an exception recovery rule corresponding to a test task, and after the exception recovery rule is obtained, perform analysis processing on the exception recovery rule, and perform fault-tolerant recovery processing on the test task according to specific content of the exception recovery rule. For example: and if the corresponding parameters a, the adjustment data b and the like are adjusted, the test task A can be continuously executed after the recovery processing is carried out according to the abnormal recovery rule A.
According to the embodiment of the application, the execution state of the NFV test task is monitored in real time, the abnormal recovery rule corresponding to the test task is obtained when the test task is abnormal, and the abnormal fault-tolerant recovery processing of the test task is carried out by using the abnormal recovery rule, so that the fault-tolerant mechanism of the test system is enhanced, the workload when the abnormal fault is positioned manually can be reduced, and the test efficiency is improved.
Further, step 202 comprises: when the test task execution failure is monitored, generating an abnormal task recovery message; acquiring an abnormal recovery rule corresponding to the test task according to the abnormal task recovery message; wherein the exception task recovery message comprises: abnormal information of the test task execution failure and/or an identification code of the test task.
The abnormal task recovery message may be generated when an abnormal monitor in the NFV test platform monitors that the test task fails to be executed, the abnormal monitor notifies a scheduling executor of the NFV test platform of the abnormal task recovery message, so as to trigger fault-tolerant processing, the scheduling executor sends the abnormal task recovery message to an abnormal resolver of the NFV test platform, and the abnormal resolver acquires an abnormal recovery rule corresponding to the test task according to specific content of the abnormal task recovery message. The exception task recovery message may include an identification code of the test task at this time, and may also include exception information of the test task failure at this time, for example, key information of the test task failure, and any one or a combination of multiple items of the identification code of the test task and the exception information of the test task failure may be matched with the exception recovery rule.
In the case that it is monitored that the test task fails to execute, the method further includes: and obtaining abnormal information of the execution failure of the test task by the test task execution log. When the test task fails to execute, the exception information of the test task failed to execute can be obtained by the exception monitor in the execution log of the test task.
Optionally, in the case that it is monitored that the test task fails to be executed, the method further includes: and carrying out abnormal fault-tolerant backup on the test task. Specifically, the execution state of the test case in the test task and the relevant information of the test case may be backed up as a snapshot. When monitoring that the test task fails, an anomaly monitor in the NFV test platform starts a backup mechanism, wherein the current test task is backed up to be a snapshot, and other test tasks executed in parallel are not influenced during the current test task backup. The structure of the backup test task as a snapshot may include: snapshot description files, parameters, output results, use case execution scripts, script descriptions, and the like.
And stopping monitoring the test task under the condition that the test task is successfully executed.
Taking an example of setting an abnormal monitor to monitor a test task, a monitoring process of the test task is shown in fig. 3, a test executive selects a test case combination (for example, case1, case2, … …, caseN) to create a new test task A, a scheduling executor of the NFV test platform starts a test flow, and outputs a test task execution log corresponding to the test task, where the test task execution log includes: the name of the test task, the unique identification ID allocated by the test platform and the system time stamp. The scheduling executor informs the abnormality monitor to add monitoring on the task state and execution log information of the test task A, if the execution result of the test task A monitored by the abnormality monitor is that the test task A is successfully executed, the monitoring is finished, and the monitoring of the test task A is removed; if the test task A fails after being executed to the case2, the anomaly monitor automatically detects the failed test task A, analyzes and acquires error information from an execution log of the test task A, and simultaneously starts a backup mechanism to backup the test task A as a snapshot. It should be noted that, during the backup of the test task a, the parallel execution of other test tasks is not affected; and after the backup is finished, sending an exception recovery message to the scheduling actuator, and informing the scheduling actuator to start an exception recovery process.
According to the embodiment, the test task is monitored in real time, the test task is backed up when the test task is abnormal, and then the abnormal recovery message is sent to the scheduling actuator, so that the scheduling actuator pulls up the abnormal resolver after receiving the abnormal recovery message, the abnormal resolver completes abnormal fault-tolerant recovery processing according to the recovery rule, the workload that the whole test task needs to be repeatedly executed when the manual positioning task is abnormally executed can be reduced, and the test efficiency is improved.
As an optional embodiment, after the generating of the abnormal task recovery message, an abnormal parser may obtain an abnormal task recovery rule matched with the test task at this time, where the obtaining of the abnormal task recovery rule corresponding to the test task according to the abnormal task recovery message includes: according to the abnormal information of the test task execution failure, at least one abnormal recovery rule corresponding to the abnormal information is matched in an abnormal rule base; or according to the identification code of the test task, matching at least one abnormal recovery rule corresponding to the identification code in an abnormal rule base.
The exception task recovery rules may be stored in an exception rule base of the NFV test platform. As shown in fig. 4, the exception rule base stores an exception recovery rule and an exception recovery script/command mapping relationship by using a relational database, and the format of the exception recovery script can be flexibly configured and can be selected from Python, Shell, and the like. The abnormal recovery rule can be composed of a common public rule and a test case task specific rule (namely a private rule), and a test executive can freely select a part of the public rule and newly add a specific private rule to complete the initialization deployment of the abnormal recovery rule corresponding to the test task after creating the test task.
Taking the example that the exception rule base includes public rules and private rules, the exception recovery rules and the mapping relationship are defined as follows:
common rules: rule ID + rule description + abnormal expression + script/Command prompt (Command, CMD) + script type;
private rules: using case ID + rule description + abnormal expression + script/CMD + script type;
and (3) task mapping: task ID + rule ID.
According to the mapping rule, the corresponding abnormal recovery rule can be matched from the abnormal rule base through the identification code of the test task or the abnormal information of the execution failure of the test task. For example: the method comprises the following steps that a test executive worker writes a rule A in an abnormal rule base aiming at a test task A, the rule A is a private rule of the test task A, and when the test task A fails to be executed, the rule A corresponding to the test task A can be directly searched in the abnormal rule base according to the ID of the test task A; or, when the test task a fails to execute, the failed exception information is information B, and one or more recovery rules available when the information B occurs in the test task execution process may be searched in the exception rule base.
It should be noted that one or more exception recovery rules may be set corresponding to the test task that fails to be currently executed.
Optionally, the performing, by using the exception recovery rule, an exception fault tolerance recovery process on the test task includes: analyzing the abnormal recovery rule according to a preset execution sequence according to the matching degree of the at least one abnormal recovery rule and the test task to obtain a rule script; and carrying out fault-tolerant recovery processing according to the rule script. After performing the exception fault tolerant restoration processing on the test task by using the exception restoration rule, the method further includes: and sending a notification message for continuing to execute the test task.
And generating prompt information under the condition that the abnormal recovery rule corresponding to the test task is not matched or fault-tolerant recovery processing fails according to the rule script.
Taking an example that an abnormal resolver in an NFV test platform executes to acquire an abnormal recovery rule and performs abnormal fault tolerance processing, an abnormal resolution process is shown in fig. 5, after receiving an abnormal task recovery message notified by a scheduling executor, the abnormal resolver performs regular matching on an abnormal rule base according to a task ID and abnormal key information in the message to acquire a matching result, and constructs all acquired matching information into an execution rule queue according to the matching degree; the recovery rules can be sequentially analyzed according to the execution sequence of the matching degree from high to low, abnormal recovery operation is executed according to the analyzed rule script, the analysis operation is immediately finished after one rule is analyzed and recovered successfully, and meanwhile, a scheduling actuator of the test task is informed to automatically pull up the abnormal snapshot to continue executing subsequent tasks;
and when the exception parser is not matched with any rule or all rule recovery operations fail, setting the current test task in a suspended state in the system, simultaneously feeding analysis failure information back to a test executive staff, the test executive staff needs to acquire a corresponding test task execution log for analysis, after specific reasons are found out, adding a corresponding new rule into the exception rule base, and triggering the scheduling executor again to perform the recovery operation of the current exception task.
The following describes a flow of the test task execution exception monitoring and recovery processing according to the embodiment of the present application.
As shown in fig. 6, after the test executor selects the test case combination, a new test task is created, the scheduling executor starts the test task to perform a test procedure, and meanwhile, the anomaly monitor monitors the test procedure to obtain an execution result of the test case caseN, and if the execution is successful, the test is ended; if the abnormal monitor monitors that the execution of the test case caseN fails, a backup mechanism is started, the test task is backed up to take a snapshot, and a notification message (namely the abnormal task recovery message) is sent to a scheduling executor after the backup is finished; the scheduling executor sends a notification message (namely the abnormal task recovery message) to an abnormal resolver; the abnormal analyzer performs rule matching in an abnormal rule base according to the task ID, abnormal key information and other contents in the message; if the abnormal recovery rule is successfully matched, analyzing the abnormal recovery rule to obtain a rule script, carrying out fault-tolerant recovery processing according to the rule script, and if the recovery is successful, informing a scheduling actuator of snapshot recovery; the scheduling executor continues to execute the test task by using the test case caseN; if the analysis of the recovery rule script fails or the recovery fails, suspending the execution of the abnormal test task, analyzing abnormal information through the intervention of test executors, adding a new rule in the abnormal rule base, and restarting the recovery operation.
According to the embodiment of the application, the execution state of the NFV test task is monitored in real time, the task is subjected to snapshot backup when the test task is abnormal, then an abnormal task recovery message is sent to the task scheduling actuator, the scheduling actuator pulls up the abnormal analyzer to automatically search the abnormal rule base to match the corresponding recovery command script after receiving the abnormal task recovery message, abnormal fault-tolerant recovery processing of the test task is carried out, the workload that the whole test task needs to be repeatedly executed when the test task is positioned manually and is abnormal can be reduced, and therefore test efficiency is improved.
As shown in fig. 7, an apparatus 700 for handling an exception of an automated test task according to an embodiment of the present invention includes:
the monitoring module 710 is configured to monitor an execution state of a network function virtualization NFV test task;
a first obtaining module 720, configured to obtain an exception recovery rule corresponding to the test task when it is monitored that the test task fails to be executed;
the first processing module 730 is configured to perform exception fault tolerance recovery processing on the test task by using the exception recovery rule.
Optionally, the first obtaining module 720 includes:
the message generating unit is used for generating an abnormal task recovery message when the test task execution failure is monitored;
a first obtaining unit, configured to obtain, according to the abnormal task recovery message, an abnormal recovery rule corresponding to the test task;
wherein the exception task recovery message comprises: exception information of the test task execution failure, and/or an identification code of the test task.
Optionally, the apparatus further comprises:
and the second acquisition module is used for acquiring the abnormal information of the execution failure of the test task from the test task execution log.
Optionally, the first obtaining unit is specifically configured to:
according to the abnormal information of the test task execution failure, at least one abnormal recovery rule corresponding to the abnormal information is matched in an abnormal rule base; or
And matching at least one abnormal recovery rule corresponding to the identification code in an abnormal rule base according to the identification code of the test task.
Optionally, the first processing module 730 includes:
the analysis unit is used for analyzing the abnormal recovery rule according to a preset execution sequence according to the matching degree of the at least one abnormal recovery rule and the test task to obtain a rule script;
and the processing unit is used for carrying out fault-tolerant recovery processing according to the rule script.
Optionally, the apparatus further comprises:
and the prompt module is used for generating prompt information under the condition that the abnormal recovery rule corresponding to the test task is not matched or fault-tolerant recovery processing fails according to the rule script.
Optionally, the apparatus further comprises:
and the backup module is used for carrying out abnormal fault-tolerant backup on the test task.
Optionally, the backup module is specifically configured to: and backing up the execution state of the test case in the test task and the relevant information of the test case as a snapshot.
Optionally, the apparatus further comprises:
and the first sending module is used for sending a notification message for continuously executing the test task.
Optionally, the apparatus further comprises:
and the second processing module is used for stopping monitoring the test task under the condition that the test task is successfully executed.
It should be noted that, the apparatus provided in the embodiment of the present invention can implement all the method steps implemented by the embodiment of the method for processing an exception of an automatic test task, and can achieve the same technical effect, and detailed descriptions of the same parts and beneficial effects as those of the embodiment of the method are omitted here.
As shown in fig. 8, an electronic device 800 in accordance with an embodiment of the invention includes a processor 810 and a transceiver 820, wherein,
the processor 810 is configured to: monitoring the execution state of a Network Function Virtualization (NFV) test task;
the transceiver 820 is configured to: under the condition that the execution failure of the test task is monitored, acquiring an abnormal recovery rule corresponding to the test task;
the processor 810 is further configured to: and carrying out exception fault tolerance recovery processing on the test task by using the exception recovery rule.
Optionally, when the transceiver acquires the abnormal recovery rule corresponding to the test task under the condition that it is monitored that the test task fails to be executed, the processor 810 is configured to: when the test task execution failure is monitored, generating an abnormal task recovery message;
the transceiver 820 is configured to obtain an exception recovery rule corresponding to the test task according to the exception task recovery message;
wherein the exception task recovery message comprises: exception information of the test task execution failure, and/or an identification code of the test task.
Optionally, in case that it is monitored that the test task fails to be executed, the transceiver 820 is further configured to: and obtaining abnormal information of the execution failure of the test task by the test task execution log.
Optionally, when the transceiver 820 acquires the abnormal recovery rule corresponding to the test task according to the abnormal task recovery message, the transceiver is specifically configured to:
according to the abnormal information of the test task execution failure, at least one abnormal recovery rule corresponding to the abnormal information is matched in an abnormal rule base; or
And matching at least one abnormal recovery rule corresponding to the identification code in an abnormal rule base according to the identification code of the test task.
Optionally, when the processor 810 performs the exception fault tolerance recovery processing on the test task by using the exception recovery rule, the exception fault tolerance recovery processing method is specifically configured to:
analyzing the abnormal recovery rule according to a preset execution sequence according to the matching degree of the at least one abnormal recovery rule and the test task to obtain a rule script;
and carrying out fault-tolerant recovery processing according to the rule script.
Optionally, the processor 810 is further configured to: and generating prompt information under the condition that the abnormal recovery rule corresponding to the test task is not matched or fault-tolerant recovery processing fails according to the rule script.
Optionally, the processor 810 is further configured to: and carrying out abnormal fault-tolerant backup on the test task.
Optionally, when the processor 810 performs the abnormal fault-tolerant backup on the test task, it is specifically configured to: and backing up the execution state of the test case in the test task and the relevant information of the test case as a snapshot.
Optionally, after performing an exception fault tolerant recovery process on the test task by using the exception recovery rule, the transceiver is further configured to: and sending a notification message for continuing to execute the test task.
Optionally, the processor 810 is further configured to: and stopping monitoring the test task under the condition that the test task is successfully executed.
It should be noted that, the electronic device provided in the embodiment of the present invention can implement all the method steps implemented by the embodiment of the method for processing an exception of an automatic test task, and can achieve the same technical effect, and detailed descriptions of the same parts and beneficial effects as those of the embodiment of the method are omitted here.
An electronic device according to another embodiment of the present invention, as shown in fig. 9, includes a transceiver 910, a processor 900, a memory 920, and a program or instructions stored in the memory 920 and executable on the processor 900; the processor 900 implements the above-mentioned method for handling the exception of the automatic test task when executing the program or the instructions.
The transceiver 910 is used for receiving and transmitting data under the control of the processor 900.
In fig. 9, among other things, the bus architecture may include any number of interconnected buses and bridges, with one or more processors, represented by processor 900, and various circuits, represented by memory 920, being linked together. The bus architecture may also link together various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. The bus interface provides an interface. The transceiver 910 may be a number of elements including a transmitter and a receiver that provide a means for communicating with various other apparatus over a transmission medium. The processor 900 is responsible for managing the bus architecture and general processing, and the memory 920 may store data used by the processor 900 in performing operations.
The readable storage medium of the embodiment of the present invention stores a program or an instruction thereon, and the program or the instruction, when executed by the processor, implements the steps in the above processing method for automatically testing task exceptions, and can achieve the same technical effects, and the details are not repeated here in order to avoid repetition.
The processor is the processor in the method for processing the exception of the automatic test task in the embodiment. The readable storage medium includes a computer readable storage medium, such as a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
It is further noted that the electronic devices described in this specification include, but are not limited to, smart phones, tablets, etc., and that many of the functional components described are referred to as modules in order to more particularly emphasize their implementation independence.
In embodiments of the present invention, modules may be implemented in software for execution by various types of processors. An identified module of executable code may, for instance, comprise one or more physical or logical blocks of computer instructions which may, for instance, be constructed as an object, procedure, or function. Nevertheless, the executables of an identified module need not be physically located together, but may comprise disparate instructions stored in different bits which, when joined logically together, comprise the module and achieve the stated purpose for the module.
Indeed, a module of executable code may be a single instruction, or many instructions, and may even be distributed over several different code segments, among different programs, and across several memory devices. Similarly, operational data may be identified within modules, and may be embodied in any suitable form and organized within any suitable type of data structure. The operational data may be collected as a single data set, or may be distributed over different locations including over different storage devices, and may exist, at least partially, merely as electronic signals on a system or network.
When a module can be implemented by software, considering the level of existing hardware technology, a module implemented by software may build a corresponding hardware circuit to implement a corresponding function, without considering cost, and the hardware circuit may include a conventional Very Large Scale Integration (VLSI) circuit or a gate array and an existing semiconductor such as a logic chip, a transistor, or other discrete components. A module may also be implemented in programmable hardware devices such as field programmable gate arrays, programmable array logic, programmable logic devices or the like.
The exemplary embodiments described above are described with reference to the drawings, and many different forms and embodiments of the invention may be made without departing from the spirit and teaching of the invention, therefore, the invention is not to be construed as limited to the exemplary embodiments set forth herein. Rather, these exemplary embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art. In the drawings, the size and relative sizes of elements may be exaggerated for clarity. The terminology used herein is for the purpose of describing particular example embodiments only and is not intended to be limiting. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. Unless otherwise indicated, a range of values, when stated, includes the upper and lower limits of the range and any subranges therebetween.
While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention as defined in the appended claims.
Claims (14)
1. A processing method for automatic test task exception is characterized by comprising the following steps:
monitoring the execution state of a Network Function Virtualization (NFV) test task;
under the condition that the execution failure of the test task is monitored, acquiring an abnormal recovery rule corresponding to the test task;
and carrying out exception fault tolerance recovery processing on the test task by using the exception recovery rule.
2. The method of claim 1, wherein obtaining an exception recovery rule corresponding to the test task if it is monitored that the test task fails to execute comprises:
when the test task execution failure is monitored, generating an abnormal task recovery message;
acquiring an abnormal recovery rule corresponding to the test task according to the abnormal task recovery message;
wherein the exception task recovery message comprises: exception information of the test task execution failure, and/or an identification code of the test task.
3. The method of claim 2, wherein in the event that execution of the test task is monitored to fail, the method further comprises:
and obtaining abnormal information of the execution failure of the test task by the test task execution log.
4. The method according to claim 2, wherein the obtaining an exception recovery rule corresponding to the test task according to the exception task recovery message includes:
according to the abnormal information of the test task execution failure, at least one abnormal recovery rule corresponding to the abnormal information is matched in an abnormal rule base; or
And matching at least one abnormal recovery rule corresponding to the identification code in an abnormal rule base according to the identification code of the test task.
5. The method according to claim 4, wherein said performing exception fault tolerant restoration processing on said test task using said exception restoration rule comprises:
analyzing the abnormal recovery rule according to a preset execution sequence according to the matching degree of the at least one abnormal recovery rule and the test task to obtain a rule script;
and carrying out fault-tolerant recovery processing according to the rule script.
6. The method of claim 5, further comprising:
and generating prompt information under the condition that the abnormal recovery rule corresponding to the test task is not matched or fault-tolerant recovery processing fails according to the rule script.
7. The method of claim 1, wherein in the event that execution of the test task is monitored to fail, the method further comprises:
and carrying out abnormal fault-tolerant backup on the test task.
8. The method of claim 7, wherein the performing an exception-tolerant backup of the test task comprises:
and backing up the execution state of the test case in the test task and the relevant information of the test case as a snapshot.
9. The method of claim 1, wherein after performing exception fault tolerant recovery processing on the test task using the exception recovery rule, the method further comprises:
and sending a notification message for continuing to execute the test task.
10. The method of claim 1, further comprising:
and stopping monitoring the test task under the condition that the test task is successfully executed.
11. An apparatus for handling automated test task exceptions, comprising:
the monitoring module is used for monitoring the execution state of the Network Function Virtualization (NFV) test task;
the first acquisition module is used for acquiring an abnormal recovery rule corresponding to the test task under the condition that the execution failure of the test task is monitored;
and the first processing module is used for performing exception fault-tolerant recovery processing on the test task by using the exception recovery rule.
12. An electronic device, comprising: a transceiver and a processor;
the processor is configured to: monitoring the execution state of a Network Function Virtualization (NFV) test task;
the transceiver is to: under the condition that the execution failure of the test task is monitored, acquiring an abnormal recovery rule corresponding to the test task;
the processor is further configured to: and carrying out exception fault tolerance recovery processing on the test task by using the exception recovery rule.
13. An electronic device, comprising: a transceiver, a processor, a memory, and a program or instructions stored on the memory and executable on the processor; a method for handling automated test task exceptions according to any one of claims 1-10 when the program or instructions are executed by the processor.
14. A readable storage medium on which a program or instructions are stored, which program or instructions, when executed by a processor, carry out the steps in the method of handling of automated test task exceptions according to any one of claims 1-10.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011431630.6A CN114595025A (en) | 2020-12-07 | 2020-12-07 | Method and device for processing automatic test task exception and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011431630.6A CN114595025A (en) | 2020-12-07 | 2020-12-07 | Method and device for processing automatic test task exception and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114595025A true CN114595025A (en) | 2022-06-07 |
Family
ID=81802511
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011431630.6A Pending CN114595025A (en) | 2020-12-07 | 2020-12-07 | Method and device for processing automatic test task exception and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114595025A (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103631713A (en) * | 2013-11-04 | 2014-03-12 | 中安消技术有限公司 | ERP software automated testing system and method |
CN109299012A (en) * | 2018-09-26 | 2019-02-01 | 广州云测信息技术有限公司 | A kind of test method, device and electronic equipment |
CN109491889A (en) * | 2018-10-10 | 2019-03-19 | 中国联合网络通信集团有限公司 | The method and apparatus of automatic test in NFV |
CN111130927A (en) * | 2019-12-04 | 2020-05-08 | 中国电子科技集团公司第三十研究所 | Method for automatically realizing service test of network layer communication terminal equipment |
CN111865695A (en) * | 2020-07-28 | 2020-10-30 | 浪潮云信息技术股份公司 | Method and system for automatic fault handling in cloud environment |
-
2020
- 2020-12-07 CN CN202011431630.6A patent/CN114595025A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103631713A (en) * | 2013-11-04 | 2014-03-12 | 中安消技术有限公司 | ERP software automated testing system and method |
CN109299012A (en) * | 2018-09-26 | 2019-02-01 | 广州云测信息技术有限公司 | A kind of test method, device and electronic equipment |
CN109491889A (en) * | 2018-10-10 | 2019-03-19 | 中国联合网络通信集团有限公司 | The method and apparatus of automatic test in NFV |
CN111130927A (en) * | 2019-12-04 | 2020-05-08 | 中国电子科技集团公司第三十研究所 | Method for automatically realizing service test of network layer communication terminal equipment |
CN111865695A (en) * | 2020-07-28 | 2020-10-30 | 浪潮云信息技术股份公司 | Method and system for automatic fault handling in cloud environment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7694181B2 (en) | Automated software testing framework | |
US9189317B1 (en) | Software sustaining system | |
CN106970880B (en) | Distributed automatic software testing method and system | |
US9311064B1 (en) | Systems and methods for automated centralized build/merge management | |
US8140908B2 (en) | System and method of client side analysis for identifying failing RAM after a user mode or kernel mode exception | |
EP3591485B1 (en) | Method and device for monitoring for equipment failure | |
JP2017517060A (en) | Fault processing method, related apparatus, and computer | |
CN109144829B (en) | Fault processing method and device, computer equipment and storage medium | |
CN112769922B (en) | Device and method for self-starting micro service cluster | |
US10795793B1 (en) | Method and system for simulating system failures using domain-specific language constructs | |
US11263072B2 (en) | Recovery of application from error | |
CN111258591B (en) | Program deployment task execution method, device, computer equipment and storage medium | |
CN112988503A (en) | Analysis method, analysis device, electronic device, and storage medium | |
CN110990289B (en) | Method and device for automatically submitting bug, electronic equipment and storage medium | |
CN111752741A (en) | System performance detection method and device | |
US20180188713A1 (en) | Method and Apparatus for Automatically Maintaining Very Large Scale of Machines | |
CN114116330A (en) | Server performance test method, system, terminal and storage medium | |
CN114595025A (en) | Method and device for processing automatic test task exception and electronic equipment | |
CN115756914A (en) | Test method, test system, test platform and test machine | |
CN113448758A (en) | Task processing method and device and terminal equipment | |
CN112069202A (en) | SQL performance analysis method, system, device and medium based on tracking technology | |
CN105677515A (en) | Online backup method and system for database | |
CN114356643B (en) | Automatic task discovery failure and recovery method in remote sensing satellite processing system | |
CN116932274B (en) | Heterogeneous computing system and server system | |
CN112860492B (en) | Automatic regression testing method and system suitable for core system |
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 |