The content of the invention
To overcome the deficiencies in the prior art, the present invention to provide a kind of test system and method for fast quick-recovery test program,
So as to reboot operation system test program can be recovered to original state in time when test program goes wrong, make
Testing efficiency must be improve.
The invention provides a kind of test system of fast quick-recovery test program, the test system includes:
Generation module, for creating virtual system and being configured, starts test program after configuration is complete;
Running status judge module, for being monitored to the running status of test program after test program starts,
When running status is normal, test program starts test assignment;Send when the running status of test program is abnormal and restart life
Order;
Restart module, for system being restarted when the reset command that the running status judge module sends is received;
Initialization module, the test parameter for test program is restarted automatically after system is restarted and to test program are carried out
Initialization operation.
Further, the generation module is additionally operable to after test program is restarted sentence the operational mode of test program
Break and corresponding operating is performed according to judged result.
Further, the operational mode includes administrator mode and user model;When for administrator mode when, to test
Data in program are modified;When for user model when, carry out test assignment into test program.
Further, the change includes adding during modification, the missing documents of initial testing parameter or changes program application
File and configuration file.
Further, the running status judge module is additionally operable to when the running status of test program is missing documents,
Missing documents signal is sent to the generation module;Operator scheme is switched after receiving missing documents signal by the generation module
For administrator mode.
Further, the generation module is specifically for when configuring to virtual system, setting up disk copy;Will
System disk is labeled as read-only;Operation is redirected to the disk copy set up;Refresh the operation of disk copy.
Present invention also offers a kind of method of testing of fast quick-recovery test program, the method for testing includes:
Create virtual system and configured, start test program after configuration is complete;
The running status of test program is monitored after test program starts, when running status is normal, test
Program starts test assignment;Reset command is sent when the running status of test program is abnormal;
System is restarted when the reset command of transmission is received;
Automatically test program is restarted after system is restarted and the test parameter to test program carries out initialization operation.
Further, the operational mode of test program is judged and is held according to judged result after test program is restarted
Row corresponding operating.
Further, the operational mode includes administrator mode and user model;When for administrator mode when, to test
Data in program are modified;When for user model when, carry out test assignment into test program;
Wherein, the change includes adding during modification, the missing documents of initial testing parameter or changes program application file
And configuration file.
Further, the establishment virtual system the step of configured, specifically includes:
Set up disk copy;
System disk is labeled as read-only;
Operation is redirected to the disk copy set up;Refresh the operation of disk copy.
The present invention compared with prior art, by test program is run under virtual system, and in virtual system
Test program is monitored, when test program goes wrong can reboot operation system initialization test program automatically, from
And reducing and be required for reconfiguring test program when re-start every time same test, it also avoid test program and collapse
The problem for needing to be safeguarded when routed manually, reduces the time configured to test program by tester, substantially reduces
Testing time, improve work efficiency.
Specific embodiment
With reference to the accompanying drawings and examples the present invention is described in further detail.
A kind of test system of the fast quick-recovery test program of the present invention, including:
Generation module, for creating virtual system and being configured, starts test program after configuration is complete;
Running status judge module, for being monitored to the running status of test program after test program starts,
When running status is normal, test program starts test assignment;Send when the running status of test program is abnormal and restart life
Order;
Restart module, for system being restarted when the reset command that the running status judge module sends is received;
Initialization module, the test parameter for test program is restarted automatically after system is restarted and to test program are carried out
Initialization operation.
The generation module is additionally operable to after test program is restarted the operational mode of test program is carried out judging and basis
Judged result performs corresponding operating.
The operational mode includes administrator mode and user model;When for administrator mode when, in test program
Data are modified;When for user model when, carry out test assignment into test program.
The change is added or is changed program application file and matches somebody with somebody when including modification, the missing documents of initial testing parameter
Put file.
The running status judge module is additionally operable to when the running status of test program is missing documents, to the generation
Module sends missing documents signal;Operator scheme is switched to manager's mould after receiving missing documents signal by the generation module
Formula.
The generation module is specifically for when configuring to virtual system, setting up disk copy;By system disk mark
It is designated as read-only;Operation is redirected to the disk copy set up;Refresh the operation of disk copy.
As shown in figure 1, the embodiment of the test system as a kind of fast quick-recovery test program of the present invention, test system
Foundation is run in virtual system (i.e. virtual opetrating system), and the test system includes:
Generation module, for virtual system being created after Windows operating system starts and being configured, completes in configuration
After start test program;
Running status judge module, for being monitored to the running status of test program after test program starts,
When running status is normal, test program starts test assignment;Test program running status for it is abnormal when to restarting module
Send reset command;
Restart module, for Windows operations are restarted after the reset command for receiving the transmission of running status judge module
System;
Initialization module, for carrying out initialization operation to the test parameter of test program after test program starts.
The generation module is additionally operable to the operational mode of test program be carried out judging and basis after test program starts
Judged result performs corresponding operating.
The operational mode includes administrator mode and user model;When for administrator mode when, user is to test program
In data be modified, addition or modification program application when the change includes modification, the missing documents of initial testing parameter
File and configuration file, after the completion of change, the data is activation after change is referred to initialization module by generation module, initializes mould
Data after change are replaced with primary data or are increased by block, send replacement to generation module and complete after replacement or increase
Signal, generation module are received after replacement completes signal and switch to user model;
When for user model when, user carries out test assignment into test program.So can avoid because in test program
In arbitrarily modification data cause to carry out also needing to carry out data manual recovery during next test, improve test effect, it is right to shorten
The time debugged by test program.Generally, user model is that test system gives tacit consent to startup item.
It is described be changed to initial testing parameter modification when, manager to test parameter modification after the completion of, generation module will
Amended test parameter is sent to outputization module, and amended test parameter is entered by initialization module with initial testing parameter
Row is replaced.
The running status judge module is additionally operable to when the running status of test program is missing documents, and running status is sentenced
Disconnected module then sends missing documents signal to generation module, and operator scheme is switched after receiving missing documents signal by generation module
For administrator mode.
Described when being changed to missing documents, manager is added or changes program practical writing to the data in test program
Part or configuration file, after the completion of operation, by the data is activation after change to initialization module, initialization module is to inciting somebody to action for generation module
Data after change write or replace into test program, to complete the reparation to test program, so that test program can
Carry out test assignment.
The administrator mode is logged in by way of user name and password, provides maintenance management entrance for manager.
The method of testing of a kind of fast quick-recovery test program of the present invention, the method for testing include:
Create virtual system and configured, start test program after configuration is complete;
The running status of test program is monitored after test program starts, when running status is normal, test
Program starts test assignment;Reset command is sent when the running status of test program is abnormal;
System is restarted when the reset command of transmission is received;
Automatically test program is restarted after system is restarted and the test parameter to test program carries out initialization operation.
The operational mode of test program is judged after test program is restarted and corresponding behaviour is performed according to judged result
Make.
The operational mode includes administrator mode and user model;When for administrator mode when, in test program
Data are modified;When for user model when, carry out test assignment into test program;
Wherein, the change includes adding during modification, the missing documents of initial testing parameter or changes program application file
And configuration file.
The establishment virtual system the step of configured, specifically includes:
Set up disk copy;
System disk is labeled as read-only;
Operation is redirected to the disk copy set up;Refresh the operation of disk copy.
As shown in Fig. 2 the embodiment of the method for testing as a kind of fast quick-recovery test program of the present invention, including it is as follows
Step:
Step one S01, after Windows operating system starts, create virtual system and simultaneously configured, after configuration is complete
Start test program;
Step 2 S02, initialization test program;
Step 3 S03, the operational mode for judging test program, if administrator mode then enters step S06;If user
Pattern then enters step S04;
Step 4 S04, the running status for judging test program, normally then enter step 5 S05;It is abnormal then J enters step
Seven S07;Missing documents then enter step S06;
Step 5 S05, test program start test assignment;
Step 6 S06, manager are modified to the data in test program, replace primary data and return after the completion of change
Step 4 S04;When the change includes modification, the missing documents of initial testing parameter addition or modification program application file and
Configuration file;When being changed to modify initial testing parameter, manager modifies to initial testing parameter, has changed
Return to step S04 into after rear replacement initial testing parameter;When for missing documents when, manager in test program add or change
Program application file or configuration file, after the completion of change, the data after change are write or are replaced into test program and is returned
Step S04.
Step S07, restart Windows operating system one S01 of return to step.
In the present invention, virtual system carries out configuring and the collocation method of virtual system in prior art can be adopted to carry out, it is also possible to
Adopt with the following method.As shown in figure 3, generation module virtual system is configured and restoration methods in virtual system match somebody with somebody
Put and comprise the following steps:
Step one S101, disk copy is set up, disk is created under virtual system, the system with Windows operating system
Disk is isolated, and so as to avoid damage to, deletes or distorts the system file in the system disk of Windows operating system by mistake;
Step 2 S102, the system disk of former Windows operating system is labeled as it is read-only, limit user operation mode under
Carry out any modification operation;
Step 3 S103, redirect operation to set up disk copy;To the system disk of Windows operating system
It is any to operate in the middle of the disk for being directed to create under the virtual system;
Step 4 S104, refresh the operation of disk copy, allow the disk created by virtual system read and write into repair
Change operation.
With reference to test system of the invention and method of testing, the present invention is described in detail:
Step one, after Windows operating system starts, generation module creates virtual system and is simultaneously configured, in configuration
After the completion of start test program and to initialization module send initialization directive;
Step 2, initialization module are initialized to test program after receiving initialization directive, and complete initial
Change backward generation module return and complete information;
Step 3, generation module judge the operational mode of test program after the information of completing is received, if manager's mould
Formula then enters step 6;If user model then enters step 4;
Step 4, running status judge module judge the running status of test program, normally then enter step 5;File lacks
Lose running status judge module to send missing documents signal to generation module and then enter step 6;It is abnormal then enter step 7;
Step 5, test program start test assignment;
Step 6, generation module enter administrator mode, and manager is modified to the data in test program, generate mould
Data is activation after change is referred to initialization module by block, initialization module the data after change and primary data are replaced or
Increasing, replacement being sent to generation module after replacement or increase and complete signal, generation module is received after replacement completes signal and returned
Return step 4;
Step 7, running status judge module send reset command to module is restarted, and restart module and receive reset command
After restart Windows operating system return to step one.
The change is added or is changed program application file and matches somebody with somebody when including modification, the missing documents of initial testing parameter
Put file;
In the step 6 when generation module receives missing documents signal, operator scheme is switched to pipe by generation module
Reason person's pattern, manager are added or change program application file or configuration file to test program, after the completion of operation, generate
, by the data is activation after change to initialization module, initialization module is to writing the data after change or replacing to test for module
In program, to complete the reparation to test program, so that test program can carry out test assignment.
When for user model when, user carries out test assignment into test program.Can so avoid because in test city
In arbitrarily modification data cause to carry out also needing to carry out data manual recovery during next test, improve test effect, it is right to shorten
The time debugged by test program.Generally, user model is that test system gives tacit consent to startup item.
In the present invention, test program is the acquiescence startup program in virtual system, and test program is to test needed for laboratory
Corresponding test program, here is not specifically limited.
Although illustrating and describing the present invention with reference to specific embodiment, it should be appreciated by those skilled in the art that:
In the case of without departing from the spirit and scope of the present invention limited by claim and its equivalent, can here carry out form and
Various change in details.