CN104750537A - Test case execution method and device - Google Patents

Test case execution method and device Download PDF

Info

Publication number
CN104750537A
CN104750537A CN201310751996.5A CN201310751996A CN104750537A CN 104750537 A CN104750537 A CN 104750537A CN 201310751996 A CN201310751996 A CN 201310751996A CN 104750537 A CN104750537 A CN 104750537A
Authority
CN
China
Prior art keywords
virtual machine
test
test execution
execution
described test
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.)
Granted
Application number
CN201310751996.5A
Other languages
Chinese (zh)
Other versions
CN104750537B (en
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201310751996.5A priority Critical patent/CN104750537B/en
Publication of CN104750537A publication Critical patent/CN104750537A/en
Application granted granted Critical
Publication of CN104750537B publication Critical patent/CN104750537B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

An embodiment of the invention discloses a test case execution method and device. The test case execution method includes synchronizing a test code to a test execution agent of a virtual machine, and sending a test case to the test execution agent; as the test execution agent executes the test case according to the test code, detecting condition of the virtual machine; as detecting the virtual machine is in the abnormal condition, recording abnormal error information of the virtual machine. According to the arrangement, the test case is executed in the virtual machine so as to avoid blue screen of a host machine of the virtual machine, and stability of the test execution is guaranteed.

Description

A kind of method and apparatus of implementation of test cases
Technical field
The present invention relates to field of computer technology, particularly relate to a kind of method and apparatus of implementation of test cases.
Background technology
Software test has become more and more universal, and software test in the process of development project in occupation of very important status.
In the prior art, the method for software test can be that unit performs test.Described unit performs test, refer to test execution and perform and control all on same machine, although this test execution scheme is simple, cost is low, when causing system blue screen mistake when performing some test case, the stability of test execution cannot be ensured.
Summary of the invention
Embodiment of the present invention technical matters to be solved is, provides a kind of method and apparatus of implementation of test cases, by implementation of test cases in virtual machine, to ensure the stability of test execution.
Embodiment of the present invention first aspect provides a kind of method of implementation of test cases, can comprise:
Test code is synchronized to the test execution agency arranged in virtual machine, and test case is sent to described test execution agency;
Perform in described test case process described test execution agency according to described test code, detect virtual machine state;
When detecting that described virtual machine state is abnormality, the exception error information of record virtual machine.
Embodiment of the present invention second aspect provides a kind of device of implementation of test cases, can comprise:
Test execution interface module, for test code being synchronized to the test execution agency arranged in virtual machine, and is sent to described test execution agency by test case;
Virtual machine detection module, for performing in described test case process described test execution agency according to described test code, detects virtual machine state;
Virtual machine debugging module, for when described virtual machine detection module detects that described virtual machine state is abnormality, the exception error information of record virtual machine.
In embodiments of the present invention, by implementation of test cases in virtual machine, make when virtual machine performs some test case and causes virtual machine to occur blue screen mistake, the host machine of virtual machine can be avoided to occur blue screen mistake, thus ensure that the stability of test execution, the exception error information about virtual machine blue screen mistake can also be recorded in time simultaneously.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, be briefly described to the accompanying drawing used required in embodiment or description of the prior art below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
The schematic flow sheet of the method for a kind of implementation of test cases that Fig. 1 provides for the embodiment of the present invention;
The schematic flow sheet of the method for the another kind of implementation of test cases that Fig. 2 provides for the embodiment of the present invention;
The schematic flow sheet of the method for another implementation of test cases that Fig. 3 provides for the embodiment of the present invention;
The structural representation of the device of a kind of implementation of test cases that Fig. 4 provides for the embodiment of the present invention;
The structural representation of the device of the another kind of implementation of test cases that Fig. 5 provides for the embodiment of the present invention;
The structural representation of a kind of virtual machine debugging module that Fig. 6 provides for the embodiment of the present invention;
The structural representation of a kind of test execution interface module that Fig. 7 provides for the embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
Refer to Fig. 1, the schematic flow sheet of the method for a kind of implementation of test cases provided for the embodiment of the present invention, described method comprises:
S101, is synchronized to the test execution agency arranged in virtual machine, and test case is sent to described test execution agency by test code;
Concrete, in host machine, create virtual machine, described virtual machine mainly provides a kind of execution environment of sandbox, and for isolating the execution to the test case with blue screen risk of errors, occurs blue screen mistake to avoid the system of host machine.Test code can be synchronized to the test execution agency arranged in virtual machine by described host machine, and test case is sent to described test execution agency, acts on behalf of perform described test case to make described test execution.Described test execution agency can run in dummy machine system, mainly provides a kind of ability of long-distance support, and for receiving test case that host system submits to and performing.
Wherein, described test code also can change a kind of executable program into, and the test code required for current test execution or executable program are synchronized in dummy machine system by described host machine.Also comprise test execution interface in described host machine, described test execution interface is for being supplied to use interface and the control end of user.Described test code or executable program can by the interprocess communication channel transfer between described test execution interface and described test execution agency, such as, by RPC(Remote Procedure Call Protocol, remote procedure call protocol) mode transmit described test code or executable program; Described test code or executable program also can be transmitted by the network file system(NFS) between described test execution interface and described test execution agency.
S102, performs in described test case process described test execution agency according to described test code, detects virtual machine state;
Concrete, perform in described test case process described test execution agency according to described test code, can detect virtual machine state in real time by virtual machine debugger, described virtual machine debugger is mainly used in monitoring described test execution agency and whether causes virtual machine generation blue screen mistake when implementation of test cases.Described virtual machine debugger is by kernel debugging technology, and utilizes the monitoring of virtual unit port realization to dummy machine system of virtual machine.For different dummy machine system types, need to use different kernel debuggers.
Certainly, when virtual machine possesses the interface of monitoring virtual machine state, also virtual machine debugger can be replaced by this interface.
S103, when detecting that described virtual machine state is abnormality, the exception error information of record virtual machine;
Concrete, when detecting that described virtual machine state is abnormality, described virtual machine debugger can also record the exception error information of virtual machine.Can for there is the state of blue screen mistake in described abnormality, the system context information of virtual machine when blue screen mistake can occur described exception error.When virtual machine generation blue screen mistake, described test execution interface can lose the connection acted on behalf of with described test execution.Described exception error information can also be sent to described test execution interface by described virtual machine debugger, makes user can check described exception error information by described test execution interface.
In embodiments of the present invention, by implementation of test cases in virtual machine, make when virtual machine performs some test case and causes virtual machine to occur blue screen mistake, the host machine of virtual machine can be avoided to occur blue screen mistake, thus ensure that the stability of test execution, the exception error information about virtual machine blue screen mistake can also be recorded in time simultaneously.
Refer to Fig. 2 again, the schematic flow sheet of the method for the another kind of implementation of test cases provided for the embodiment of the present invention, described method comprises:
S201, starts virtual machine and carries out initialization to described virtual machine;
Concrete, in host machine, create virtual machine, described virtual machine mainly provides a kind of execution environment of sandbox, and for isolating the execution to the test case with blue screen risk of errors, occurs blue screen mistake to avoid the system of host machine.When needs during implementation of test cases, can start virtual machine by virtual machine controller and carry out initialization to described virtual machine in virtual machine.Described virtual machine controller is used for host system and controls virtual machine activation, restart and recover etc.Virtual machine controller is that the control interface provided by virtual machine is realized, and according to the difference of the dummy machine system used, interface can difference to some extent.
S202, is synchronized to the test execution agency arranged in virtual machine by test code;
Test code can be synchronized to the test execution agency arranged in virtual machine by described host machine.Described test execution agency can run in dummy machine system, mainly provides a kind of ability of long-distance support, and for receiving test case that host system submits to and performing.
Wherein, described test code also can change a kind of executable program into, and the test code required for current test execution or executable program are synchronized in dummy machine system by described host machine.Also comprise test execution interface in described host machine, described test execution interface is for being supplied to use interface and the control end of user.Described test code or executable program by the interprocess communication channel transfer between described test execution interface and described test execution agency, such as, can transmit described test code or executable program by the mode of RPC; Described test code or executable program also can be transmitted by the network file system(NFS) between described test execution interface and described test execution agency.
S203, carries out serializing process to test case, and the test case after serializing is sent to described test execution agency, acts on behalf of carry out unserializing process to get described test case to the test case after described serializing to make described test execution;
Concrete, at described test execution interface, described test case is sent in the process of described test execution agency, described test execution interface carries out serializing process to test case, and the test case after serializing is sent to described test execution agency, act on behalf of to make described test execution and unserializing process is carried out to get described test case to the test case after described serializing.
S204, performs in described test case process described test execution agency according to described test code, detects virtual machine state;
Concrete, perform in described test case process described test execution agency according to described test code, can detect virtual machine state in real time by virtual machine debugger, described virtual machine debugger is mainly used in monitoring described test execution agency and whether causes virtual machine generation blue screen mistake when implementation of test cases.Described virtual machine debugger is by kernel debugging technology, and utilizes the monitoring of virtual unit port realization to dummy machine system of virtual machine.For different dummy machine system types, need to use different kernel debuggers.
S205, when detecting that described virtual machine state is abnormality, gathers the system context information of virtual machine;
S206, is recorded as the exception error information of virtual machine by the system context information of described virtual machine;
Concrete, when detecting that described virtual machine state is abnormality, described virtual machine debugger can also gather the system context information of virtual machine, and the system context information of described virtual machine is recorded as the exception error information of virtual machine.Can for there is the state of blue screen mistake in described abnormality, the system context information of virtual machine when blue screen mistake can occur described exception error.When virtual machine generation blue screen mistake, described test execution interface can lose the connection acted on behalf of with described test execution.
S207, controls described virtual machine and restarts and recover;
After described virtual machine debugger have recorded described exception error information, described virtual machine controller can also control described virtual machine and restarts and recover.
S208, points out the exception error information of described virtual machine;
After described virtual machine debugger have recorded described exception error information, described host machine can point out the exception error information of described virtual machine to user, its implementation procedure can be: the exception error information recording the described virtual machine obtained is sent to described test execution interface by described virtual machine debugger, the exception error information of described virtual machine can be sent to client by described test execution interface, makes user can check the exception error information of described virtual machine.
In embodiments of the present invention, by implementation of test cases in virtual machine, make when virtual machine performs some test case and causes virtual machine to occur blue screen mistake, the host machine of virtual machine can be avoided to occur blue screen mistake, thus ensure that the stability of test execution, the exception error information about virtual machine blue screen mistake can also be recorded in time simultaneously.
Refer to Fig. 3 again, the schematic flow sheet of the method for another implementation of test cases provided for the embodiment of the present invention, described method comprises:
S301, starts virtual machine and carries out initialization to described virtual machine;
Concrete, in host machine, create virtual machine, described virtual machine mainly provides a kind of execution environment of sandbox, and for isolating the execution to the test case with blue screen risk of errors, occurs blue screen mistake to avoid the system of host machine.When needs during implementation of test cases, can start virtual machine by virtual machine controller and carry out initialization to described virtual machine in virtual machine.Described virtual machine controller is used for host system and controls virtual machine activation, restart and recover etc.Virtual machine controller is that the control interface provided by virtual machine is realized, and according to the difference of the dummy machine system used, interface can difference to some extent.
S302, is synchronized to the test execution agency arranged in virtual machine by test code;
Test code can be synchronized to the test execution agency arranged in virtual machine by described host machine.Described test execution agency can run in dummy machine system, mainly provides a kind of ability of long-distance support, and for receiving test case that host system submits to and performing.
Wherein, described test code also can change a kind of executable program into, and the test code required for current test execution or executable program are synchronized in dummy machine system by described host machine.Also comprise test execution interface in described host machine, described test execution interface is for being supplied to use interface and the control end of user.Described test code or executable program by the interprocess communication channel transfer between described test execution interface and described test execution agency, such as, can transmit described test code or executable program by the mode of RPC; Described test code or executable program also can be transmitted by the network file system(NFS) between described test execution interface and described test execution agency.
S303, carries out serializing process to test case, and the test case after serializing is sent to described test execution agency, acts on behalf of carry out unserializing process to get described test case to the test case after described serializing to make described test execution;
Concrete, at described test execution interface, described test case is sent in the process of described test execution agency, described test execution interface carries out serializing process to test case, and the test case after serializing is sent to described test execution agency, act on behalf of to make described test execution and unserializing process is carried out to get described test case to the test case after described serializing.
S304, performs in described test case process described test execution agency according to described test code, detects virtual machine state;
Concrete, perform in described test case process described test execution agency according to described test code, can detect virtual machine state in real time by virtual machine debugger, described virtual machine debugger is mainly used in monitoring described test execution agency and whether causes virtual machine generation blue screen mistake when implementation of test cases.Described virtual machine debugger is by kernel debugging technology, and utilizes the monitoring of virtual unit port realization to dummy machine system of virtual machine.For different dummy machine system types, need to use different kernel debuggers.
S305, when detecting that described virtual machine state is normal condition, judges that described test execution acts on behalf of the whether complete described test case of successful execution;
Concrete, when described virtual machine debugger detects that described virtual machine state is normal condition, namely dummy machine system normally runs, then can judge that described test execution acts on behalf of the whether complete described test case of successful execution.When described virtual machine debugger detects that described virtual machine state is abnormality, i.e. dummy machine system generation blue screen mistake, then can record the exception error information about virtual machine blue screen mistake.
S306, receives the normal execution result that described test execution agency sends;
When judging that in the step of S305 described test execution acts on behalf of the complete described test case of successful execution, the normal execution result that can be sent by test execution agency described in described test execution interface.
S307, receives the abnormal execution result that described test execution agency sends;
When judging that in the step of S305 described test execution agency does not have a complete described test case of successful execution, can by the abnormal execution result of test execution agency transmission described in described test execution interface.
In embodiments of the present invention, by implementation of test cases in virtual machine, make when virtual machine performs some test case and causes virtual machine to occur blue screen mistake, the host machine of virtual machine can be avoided to occur blue screen mistake, thus ensure that the stability of test execution, simultaneously about the exception error information of virtual machine blue screen mistake, and also can also can execute the execution result after test case by sink virtual machine when virtual machine normally runs by record in time.
Refer to Fig. 4, the structural representation of the device 1 of a kind of implementation of test cases provided for the embodiment of the present invention, the device 1 of described implementation of test cases comprises: test execution interface module 10, virtual machine detection module 20, virtual machine debugging module 30;
Described test execution interface module 10, for test code being synchronized to the test execution agency arranged in virtual machine, and is sent to described test execution agency by test case;
Concrete, in host machine, create virtual machine, described virtual machine mainly provides a kind of execution environment of sandbox, and for isolating the execution to the test case with blue screen risk of errors, occurs blue screen mistake to avoid the system of host machine.Test code can be synchronized to the test execution agency arranged in virtual machine by described test execution interface module 10, and test case is sent to described test execution agency, acts on behalf of perform described test case to make described test execution.Described test execution agency can run in dummy machine system, mainly provides a kind of ability of long-distance support, and for receiving test case that host system submits to and performing.
Wherein, described test code also can change a kind of executable program into, and the test code required for current test execution or executable program are synchronized in dummy machine system by described test execution interface module 10.Described test execution interface module 10 can be a kind of test execution interface, and described test execution interface is use interface for being supplied to user and control end.Described test code or executable program by the interprocess communication channel transfer between described test execution interface module 10 and described test execution agency, such as, can transmit described test code or executable program by the mode of RPC; Described test code or executable program also can be transmitted by the network file system(NFS) between described test execution interface module 10 and described test execution agency.
Described virtual machine detection module 20, for performing in described test case process described test execution agency according to described test code, detects virtual machine state;
Concrete, perform in described test case process described test execution agency according to described test code, described virtual machine detection module 20 can detect virtual machine state in real time, described virtual machine detection module 20 can be a kind of virtual machine debugger, and described virtual machine debugger is mainly used in monitoring described test execution agency and whether causes virtual machine generation blue screen mistake when implementation of test cases.Described virtual machine debugger is by kernel debugging technology, and utilizes the monitoring of virtual unit port realization to dummy machine system of virtual machine.For different dummy machine system types, need to use different kernel debuggers.
Certainly, when virtual machine possesses the interface of monitoring virtual machine state, also virtual machine debugger can be replaced by this interface.
Described virtual machine debugging module 30, for when described virtual machine detection module 20 detects that described virtual machine state is abnormality, the exception error information of record virtual machine;
Concrete, when described virtual machine detection module 20 detects that described virtual machine state is abnormality, described virtual machine debugging module 30 can record the exception error information of virtual machine.Can for there is the state of blue screen mistake in described abnormality, the system context information of virtual machine when blue screen mistake can occur described exception error.When virtual machine generation blue screen mistake, described test execution interface can lose the connection acted on behalf of with described test execution.Described exception error information can also be sent to described test execution interface by described virtual machine debugging module 30, makes user can check described exception error information by described test execution interface module 10.Described virtual machine debugging module 30 and described virtual machine detection module 20 can with belonging to a virtual machine debugger.
In embodiments of the present invention, by implementation of test cases in virtual machine, make when virtual machine performs some test case and causes virtual machine to occur blue screen mistake, the host machine of virtual machine can be avoided to occur blue screen mistake, thus ensure that the stability of test execution, the exception error information about virtual machine blue screen mistake can also be recorded in time simultaneously.
Refer to Fig. 5 again, the structural representation of the device 1 of the another kind of implementation of test cases provided for the embodiment of the present invention, the device 1 of described implementation of test cases comprises: test execution interface module 10, virtual machine detection module 20, virtual machine debugging module 30, judge module 40, virtual machine control module 50;
Described test execution interface module 10, for test code being synchronized to the test execution agency arranged in virtual machine, and is sent to described test execution agency by test case;
Concrete, in host machine, create virtual machine, described virtual machine mainly provides a kind of execution environment of sandbox, and for isolating the execution to the test case with blue screen risk of errors, occurs blue screen mistake to avoid the system of host machine.Test code can be synchronized to the test execution agency arranged in virtual machine by described test execution interface module 10, and test case is sent to described test execution agency, acts on behalf of perform described test case to make described test execution.Described test execution agency can run in dummy machine system, mainly provides a kind of ability of long-distance support, and for receiving test case that host system submits to and performing.
Wherein, described test code also can change a kind of executable program into, and the test code required for current test execution or executable program are synchronized in dummy machine system by described test execution interface module 10.Described test execution interface module 10 can be a kind of test execution interface, and described test execution interface is use interface for being supplied to user and control end.Described test code or executable program by the interprocess communication channel transfer between described test execution interface module 10 and described test execution agency, such as, can transmit described test code or executable program by the mode of RPC; Described test code or executable program also can be transmitted by the network file system(NFS) between described test execution interface module 10 and described test execution agency.
Described virtual machine detection module 20, for performing in described test case process described test execution agency according to described test code, detects virtual machine state;
Concrete, perform in described test case process described test execution agency according to described test code, described virtual machine detection module 20 can detect virtual machine state in real time, described virtual machine detection module 20 can be a kind of virtual machine debugger, and described virtual machine debugger is mainly used in monitoring described test execution agency and whether causes virtual machine generation blue screen mistake when implementation of test cases.Described virtual machine debugger is by kernel debugging technology, and utilizes the monitoring of virtual unit port realization to dummy machine system of virtual machine.For different dummy machine system types, need to use different kernel debuggers.
Certainly, when virtual machine possesses the interface of monitoring virtual machine state, also virtual machine debugger can be replaced by this interface.
Described virtual machine debugging module 30, for when described virtual machine detection module 20 detects that described virtual machine state is abnormality, the exception error information of record virtual machine;
Concrete, when described virtual machine detection module 20 detects that described virtual machine state is abnormality, described virtual machine debugging module 30 can record the exception error information of virtual machine.Can for there is the state of blue screen mistake in described abnormality, the system context information of virtual machine when blue screen mistake can occur described exception error.When virtual machine generation blue screen mistake, described test execution interface can lose the connection acted on behalf of with described test execution.Described exception error information can also be sent to described test execution interface by described virtual machine debugging module 30, makes user can check described exception error information by described test execution interface module 10.Described virtual machine debugging module 30 and described virtual machine detection module 20 can with belonging to a virtual machine debugger.
Described judge module 40, for when described virtual machine detection module 20 detects that described virtual machine state is normal condition, judges that described test execution acts on behalf of the whether complete described test case of successful execution;
Concrete, when described virtual machine detection module 20 detects that described virtual machine state is normal condition, described judge module 40 can judge that described test execution acts on behalf of the whether complete described test case of successful execution.Now, described test execution interface module 10, if be also judged as YES for described judge module 40, then receives the normal execution result that described test execution agency sends; Described test execution interface module 10, if be also judged as NO for described judge module 40, then receives the abnormal execution result that described test execution agency sends.
Described virtual machine control module 50, after recording the exception error information of virtual machine at described virtual machine debugging module 30, controls described virtual machine and restarts and recover;
Concrete, described virtual machine control module 50 after described virtual machine debugging module 30 records the exception error information of virtual machine, can control described virtual machine and restarts and recover.Described virtual machine control module 50 can be a kind of virtual machine controller, and described virtual machine controller is used for host system and controls virtual machine activation, restart and recover etc.Virtual machine controller is that the control interface provided by virtual machine is realized, and according to the difference of the dummy machine system used, interface can difference to some extent.
When needs are in virtual machine during implementation of test cases, described virtual machine control module 50 is also for starting virtual machine and carrying out initialization to described virtual machine.
In addition, described test execution interface module 10, also for receiving the exception error information of described virtual machine of described virtual machine debugging module 30 record, and the exception error information of described virtual machine received by prompting;
Concrete, the exception error information of the described virtual machine received can be issued to client by described test execution interface module 10, makes user can check the exception error information of described virtual machine.
The device 1 of described implementation of test cases and virtual machine can belong to a host machine, have so not only saved cost, also assures that the stability of test execution.
Further, then refer to Fig. 6, be the structural representation of a kind of virtual machine debugging module 30 that the embodiment of the present invention provides, described virtual machine debugging module 30 can comprise: collecting unit 301, information recording unit 302;
Described collecting unit 301, for when described virtual machine debugging module 30 detects that described virtual machine state is abnormality, gathers the system context information of virtual machine;
Described information recording unit 302, for being recorded as the exception error information of virtual machine by the system context information of described virtual machine.
Further, then refer to Fig. 7, be the structural representation of a kind of test execution interface module 10 that the embodiment of the present invention provides, described test execution interface module 10 can comprise: lock unit 101, serializing transmitting element 102;
Described lock unit 101, for being synchronized to the test execution agency arranged in virtual machine by test code;
Described serializing transmitting element 102, for carrying out serializing process to test case, and the test case after serializing is sent to described test execution agency, act on behalf of to make described test execution and unserializing process is carried out to get described test case to the test case after described serializing.
In embodiments of the present invention, by implementation of test cases in virtual machine, make when virtual machine performs some test case and causes virtual machine to occur blue screen mistake, the host machine of virtual machine can be avoided to occur blue screen mistake, thus ensure that the stability of test execution, the exception error information about virtual machine blue screen mistake can also be recorded in time simultaneously.
One of ordinary skill in the art will appreciate that all or part of flow process realized in above-described embodiment method, that the hardware that can carry out instruction relevant by computer program has come, described program can be stored in a computer read/write memory medium, this program, when performing, can comprise the flow process of the embodiment as above-mentioned each side method.Wherein, described storage medium can be magnetic disc, CD, read-only store-memory body (Read-Only Memory, ROM) or random store-memory body (Random Access Memory, RAM) etc.
Above disclosedly be only present pre-ferred embodiments, certainly can not limit the interest field of the present invention with this, therefore according to the equivalent variations that the claims in the present invention are done, still belong to the scope that the present invention is contained.

Claims (14)

1. a method for implementation of test cases, is characterized in that, comprising:
Test code is synchronized to the test execution agency arranged in virtual machine, and test case is sent to described test execution agency;
Perform in described test case process described test execution agency according to described test code, detect virtual machine state;
When detecting that described virtual machine state is abnormality, the exception error information of record virtual machine.
2. the method for claim 1, is characterized in that, described when detecting that described virtual machine state is abnormality, and the exception error information of record virtual machine, comprising:
When detecting that described virtual machine state is abnormality, gather the system context information of virtual machine;
The system context information of described virtual machine is recorded as the exception error information of virtual machine.
3. method as claimed in claim 2, is characterized in that, the described test execution arranged in virtual machine that is synchronized to by test code is acted on behalf of, and test case is sent to described test execution agency, comprising:
Test code is synchronized to the test execution agency arranged in virtual machine;
Serializing process is carried out to test case, and the test case after serializing is sent to described test execution agency, act on behalf of to make described test execution and unserializing process is carried out to get described test case to the test case after described serializing.
4. method as claimed in claim 3, is characterized in that, also comprise:
When detecting that described virtual machine state is normal condition, judge that described test execution acts on behalf of the whether complete described test case of successful execution;
If be judged as YES, then receive the normal execution result that described test execution agency sends;
If be judged as NO, then receive the abnormal execution result that described test execution agency sends.
5. method as claimed in claim 4, is characterized in that, described detect that described virtual machine state is abnormality time, after the step of the exception error information of record virtual machine, also comprise:
Control described virtual machine restart and recover.
6. method as claimed in claim 5, is characterized in that, described detect that described virtual machine state is abnormality time, after the step of the exception error information of record virtual machine, also comprise:
Point out the exception error information of described virtual machine.
7. method as claimed in claim 6, is characterized in that, test code is synchronized to the test execution agency arranged in virtual machine, and before test case being sent to the step of described test execution agency, also comprises described:
Start virtual machine and initialization is carried out to described virtual machine.
8. a device for implementation of test cases, is characterized in that, comprising:
Test execution interface module, for test code being synchronized to the test execution agency arranged in virtual machine, and is sent to described test execution agency by test case;
Virtual machine detection module, for performing in described test case process described test execution agency according to described test code, detects virtual machine state;
Virtual machine debugging module, for when described virtual machine detection module detects that described virtual machine state is abnormality, the exception error information of record virtual machine.
9. device as claimed in claim 8, it is characterized in that, described virtual machine debugging module comprises:
Collecting unit, for when described virtual machine debugging module detects that described virtual machine state is abnormality, gathers the system context information of virtual machine;
Information recording unit, for being recorded as the exception error information of virtual machine by the system context information of described virtual machine.
10. device as claimed in claim 9, it is characterized in that, described test execution interface module comprises:
Lock unit, for being synchronized to the test execution agency arranged in virtual machine by test code;
Serializing transmitting element, for carrying out serializing process to test case, and the test case after serializing is sent to described test execution agency, act on behalf of to make described test execution and unserializing process is carried out to get described test case to the test case after described serializing.
11. devices as claimed in claim 10, is characterized in that, also comprise:
Judge module, for when described virtual machine detection module detects that described virtual machine state is normal condition, judges that described test execution acts on behalf of the whether complete described test case of successful execution;
Described test execution interface module, if be also judged as YES for described judge module, then receives the normal execution result that described test execution agency sends;
Described test execution interface module, if be also judged as NO for described judge module, then receives the abnormal execution result that described test execution agency sends.
12. devices as claimed in claim 11, is characterized in that, also comprise:
Virtual machine control module, for after the exception error information of described virtual machine debugging module record virtual machine, controls described virtual machine and restarts and recover.
13. devices as claimed in claim 12, is characterized in that,
Described test execution interface module, also for receiving the exception error information of the described virtual machine of described virtual machine debugging module record, and the exception error information of described virtual machine received by prompting.
14. methods as claimed in claim 13, is characterized in that,
Described virtual machine control module, also for starting described virtual machine and carrying out initialization to described virtual machine.
CN201310751996.5A 2013-12-31 2013-12-31 Method and device for executing test case Active CN104750537B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310751996.5A CN104750537B (en) 2013-12-31 2013-12-31 Method and device for executing test case

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310751996.5A CN104750537B (en) 2013-12-31 2013-12-31 Method and device for executing test case

Publications (2)

Publication Number Publication Date
CN104750537A true CN104750537A (en) 2015-07-01
CN104750537B CN104750537B (en) 2020-07-14

Family

ID=53590283

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310751996.5A Active CN104750537B (en) 2013-12-31 2013-12-31 Method and device for executing test case

Country Status (1)

Country Link
CN (1) CN104750537B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106598594A (en) * 2016-12-14 2017-04-26 捷开通讯(深圳)有限公司 Test system and method for quickly restoring test program
CN107729187A (en) * 2017-11-03 2018-02-23 郑州云海信息技术有限公司 A kind of test case management disaster recovery method and system based on virtual platform
CN111355629A (en) * 2020-02-17 2020-06-30 苏州亿歌网络科技有限公司 Client test method and device, computer equipment and storage medium
CN113703913A (en) * 2021-08-06 2021-11-26 长江存储科技有限责任公司 Equipment testing method and device
WO2023087642A1 (en) * 2021-11-19 2023-05-25 上海商汤智能科技有限公司 User code running method and apparatus, and electronic device and storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040025088A1 (en) * 2002-08-01 2004-02-05 Sun Microsystems, Inc. Software application test coverage analyzer
US20050223362A1 (en) * 2004-04-02 2005-10-06 Gemstone Systems, Inc. Methods and systems for performing unit testing across multiple virtual machines
CN101252471A (en) * 2008-03-20 2008-08-27 中兴通讯股份有限公司 Distributed automatization test system and method
CN101447892A (en) * 2008-11-24 2009-06-03 中兴通讯股份有限公司 Distributed test method, system and test server
CN102637144A (en) * 2012-03-31 2012-08-15 奇智软件(北京)有限公司 System fault processing method and device
US20120254660A1 (en) * 2011-03-30 2012-10-04 International Business Machines Corporation Processing test cases for applications to be tested
CN102779094A (en) * 2012-08-21 2012-11-14 深圳中兴网信科技有限公司 Terminal and software exception test method
CN102866950A (en) * 2012-09-13 2013-01-09 浪潮(北京)电子信息产业有限公司 Performance testing method and testing tool for virtual server
CN102902599A (en) * 2012-09-17 2013-01-30 华为技术有限公司 Virtual machine internal fault processing method, device and system

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040025088A1 (en) * 2002-08-01 2004-02-05 Sun Microsystems, Inc. Software application test coverage analyzer
US20050223362A1 (en) * 2004-04-02 2005-10-06 Gemstone Systems, Inc. Methods and systems for performing unit testing across multiple virtual machines
CN101252471A (en) * 2008-03-20 2008-08-27 中兴通讯股份有限公司 Distributed automatization test system and method
CN101447892A (en) * 2008-11-24 2009-06-03 中兴通讯股份有限公司 Distributed test method, system and test server
US20120254660A1 (en) * 2011-03-30 2012-10-04 International Business Machines Corporation Processing test cases for applications to be tested
CN102637144A (en) * 2012-03-31 2012-08-15 奇智软件(北京)有限公司 System fault processing method and device
CN102779094A (en) * 2012-08-21 2012-11-14 深圳中兴网信科技有限公司 Terminal and software exception test method
CN102866950A (en) * 2012-09-13 2013-01-09 浪潮(北京)电子信息产业有限公司 Performance testing method and testing tool for virtual server
CN102902599A (en) * 2012-09-17 2013-01-30 华为技术有限公司 Virtual machine internal fault processing method, device and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
钟华: ""基于云计算的软件测试服务研究"", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106598594A (en) * 2016-12-14 2017-04-26 捷开通讯(深圳)有限公司 Test system and method for quickly restoring test program
CN106598594B (en) * 2016-12-14 2020-09-01 捷开通讯(深圳)有限公司 Test system and method for rapidly recovering test program
CN107729187A (en) * 2017-11-03 2018-02-23 郑州云海信息技术有限公司 A kind of test case management disaster recovery method and system based on virtual platform
CN111355629A (en) * 2020-02-17 2020-06-30 苏州亿歌网络科技有限公司 Client test method and device, computer equipment and storage medium
CN111355629B (en) * 2020-02-17 2021-01-15 苏州亿歌网络科技有限公司 Client test method and device, computer equipment and storage medium
CN113703913A (en) * 2021-08-06 2021-11-26 长江存储科技有限责任公司 Equipment testing method and device
CN113703913B (en) * 2021-08-06 2024-04-23 长江存储科技有限责任公司 Equipment testing method and device
WO2023087642A1 (en) * 2021-11-19 2023-05-25 上海商汤智能科技有限公司 User code running method and apparatus, and electronic device and storage medium

Also Published As

Publication number Publication date
CN104750537B (en) 2020-07-14

Similar Documents

Publication Publication Date Title
US8910172B2 (en) Application resource switchover systems and methods
EP3121726B1 (en) Fault processing method, related device and computer
EP2798428B1 (en) Apparatus and method for managing operation of a mobile device
CN104750537A (en) Test case execution method and device
CN102880527B (en) Data recovery method of baseboard management controller
CN103455397A (en) System self-test method, equipment and system
CN101873462A (en) DVR (Digital Video Recorder) as well as data backup and recovery method and system thereof
US10514972B2 (en) Embedding forensic and triage data in memory dumps
CN114600088A (en) Server state monitoring system and method using baseboard management controller
CN110704228A (en) Solid state disk exception handling method and system
CN103617102A (en) Fault disk isolation method and device and storage system
CN109885420B (en) PCIe link fault analysis method, BMC and storage medium
CN116724297A (en) Fault processing method, device and system
CN112162882A (en) Data hot snapshot method, device, equipment and computer readable storage medium
CN111130856A (en) Server configuration method, system, equipment and computer readable storage medium
JP5674730B2 (en) Communication error between data card and host and method for recovery of data card error
CN113849350A (en) Ring-shaped two-place three-center topology switching method, device, system and medium
CN111176909A (en) Method and device for recovering use of disk and storage equipment
CN108664366B (en) Data transmission method and device and server
CN105426273A (en) Method for recovering data of physical memory unit as well as server
CN109542700A (en) The test method and device of the PCIE interface link rate of magnetic disc array card
CN109361572A (en) A kind of mainframe cluster management method and relevant apparatus
CN104079453A (en) Enumeration method and device for debugging equipment
US9417863B2 (en) System and method for expedited loading of an image onto a storage device
CN112463446B (en) PCIe device recovery method and system, electronic device and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant