CN110058920B - Virtual machine performance detection method and device, electronic equipment and storage medium - Google Patents

Virtual machine performance detection method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN110058920B
CN110058920B CN201910161318.0A CN201910161318A CN110058920B CN 110058920 B CN110058920 B CN 110058920B CN 201910161318 A CN201910161318 A CN 201910161318A CN 110058920 B CN110058920 B CN 110058920B
Authority
CN
China
Prior art keywords
virtual machine
test
target virtual
target
script
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.)
Active
Application number
CN201910161318.0A
Other languages
Chinese (zh)
Other versions
CN110058920A (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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201910161318.0A priority Critical patent/CN110058920B/en
Publication of CN110058920A publication Critical patent/CN110058920A/en
Priority to PCT/CN2019/118021 priority patent/WO2020177385A1/en
Application granted granted Critical
Publication of CN110058920B publication Critical patent/CN110058920B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0706Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
    • G06F11/0712Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment in a virtual computing platform, e.g. logically partitioned systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/57Certifying or maintaining trusted computer platforms, e.g. secure boots or power-downs, version controls, system software checks, secure updates or assessing vulnerabilities
    • G06F21/577Assessing vulnerabilities and evaluating computer system security
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45591Monitoring or debugging support

Abstract

The embodiment of the invention provides a method and a device for detecting the performance of a virtual machine, electronic equipment and a storage medium, which relate to the technical field of testing and comprise the following steps: receiving a request for creating a test virtual machine, wherein the request for creating the test virtual machine comprises a first configuration parameter and a second configuration parameter; creating a test virtual machine according to the first configuration parameter and the second configuration parameter; determining a target virtual machine which accords with a preset rule from a preset virtual machine configuration table based on the test virtual machine; sending a test script generated by the test virtual machine to the target virtual machine so as to test the target virtual machine according to the test script; and determining the detection result of the target virtual machine according to the test response generated by the target virtual machine. The technical scheme of the embodiment of the invention not only can automatically test the communication performance of a plurality of virtual machines, but also can improve the accuracy of the test process and ensure the test efficiency.

Description

Virtual machine performance detection method and device, electronic equipment and storage medium
Technical Field
The invention relates to the technical field of testing, in particular to a virtual machine performance detection method, a virtual machine performance detection device, electronic equipment and a computer readable storage medium.
Background
With the development of internet technology, virtual machines (Virtual machines) are used more and more widely, and a large number of Virtual machines are often required in many aspects such as computer performance tests or enterprise internal system requirements, so that detection of communication performance of the Virtual machines is very important.
At present, in the existing technical scheme, when the communication performance of a virtual machine based on a Windows operating system is verified, an account password needs to be manually input in a manual mode for login, and meanwhile, a corresponding service is deployed and started on the virtual machine. The operation has higher requirement on network professional skills of personnel in charge of verification, and when the number of virtual machines is large, the manual mode cannot perform verification in batches, the working efficiency is low, and meanwhile, the problem that the password cannot be logged in due to input errors easily occurs.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present invention and therefore may include information that does not constitute prior art known to a person of ordinary skill in the art.
Disclosure of Invention
Embodiments of the present invention provide a method for detecting performance of a virtual machine, a device for detecting performance of a virtual machine, an electronic device, and a computer-readable storage medium, so as to overcome, at least to a certain extent, the problems that when the communication performance of a virtual machine is tested in a manual manner, batch testing cannot be performed, the working efficiency is low, and meanwhile, a password cannot be logged in due to a password input error easily occur.
Additional features and advantages of the invention will be set forth in the detailed description which follows, or may be learned by practice of the invention.
According to a first aspect of the embodiments of the present invention, a method for detecting performance of a virtual machine is provided, including: receiving a request for creating a test virtual machine, wherein the request for creating the test virtual machine comprises an operating system type, a first configuration parameter and a second configuration parameter of the test virtual machine; creating a test virtual machine according to the first configuration parameter and the second configuration parameter; determining a target virtual machine which accords with a preset rule from a preset virtual machine configuration table based on the test virtual machine; sending a test script generated by the test virtual machine to the target virtual machine so as to test the target virtual machine according to the test script; and determining the detection result of the target virtual machine according to the test response generated by the target virtual machine.
In an exemplary embodiment of the present invention, based on the above scheme, creating a test virtual machine according to the first configuration parameter and the second configuration parameter includes: determining a communication tool of the test virtual machine according to the first configuration parameter; determining a script writing tool of the test virtual machine according to the second configuration parameter; creating the test virtual machine based on the communication tool and the scripting tool.
In an example embodiment of the present invention, based on the above scheme, the determining, based on the test virtual machine, a target virtual machine that meets a preset rule from a preset virtual machine configuration table includes: acquiring a preset rule and a preset virtual machine configuration table stored on a physical machine corresponding to the test virtual machine; and filtering the virtual machines in the preset virtual machine configuration table according to the preset rule, and determining the virtual machines meeting the preset rule as target virtual machines.
In an example embodiment of the present invention, based on the above scheme, the sending the test script generated by the test virtual machine to the target virtual machine to test the target virtual machine according to the test script includes: generating a test script according to the preset virtual machine configuration table and a script writing tool of the test virtual machine; and sending the test script to the target virtual machine through a communication tool of the test virtual machine so as to test the target virtual machine according to the test script.
In an example embodiment of the present invention, based on the above scheme, before the sending the test script generated by the test virtual machine to the target virtual machine to test the target virtual machine according to the test script, the method further includes: sending a login request to the target virtual machine through a communication tool of the test virtual machine; the login request comprises a login account and a login password of the target virtual machine; and responding to successful login of the target virtual machine, and sending a test script generated by the test virtual machine to the target virtual machine so as to test the target virtual machine according to the test script.
In an example embodiment of the present invention, based on the above scheme, the communication tool includes multiple parallel threads, and the sending the test script generated by the test virtual machine to the target virtual machine includes: distributing sending tasks of the test scripts generated by the test virtual machines to at least two parallel threads in the multiple parallel threads according to the number of the target virtual machines; and sending the test script to the corresponding target virtual machine according to the sending tasks of the test script of at least two parallel threads.
In an example embodiment of the present invention, based on the above scheme, the determining, according to the test response generated by the target virtual machine, a detection result of the target virtual machine includes: acquiring a test response generated by the target virtual machine executing the test script; and determining a detection result corresponding to the test response of the target virtual machine according to a preset corresponding relation table of the test response and the detection result.
According to a second aspect of the embodiments of the present invention, there is provided a virtual machine performance detection apparatus, including: the virtual machine testing system comprises a receiving module, a judging module and a processing module, wherein the receiving module is used for receiving a request for creating a testing virtual machine, and the request for creating the testing virtual machine comprises an operating system type, a first configuration parameter and a second configuration parameter of the testing virtual machine; the creating module is used for creating a test virtual machine according to the first configuration parameter and the second configuration parameter; the screening module is used for determining a target virtual machine which accords with a preset rule from a preset virtual machine configuration table based on the test virtual machine; the test module is used for sending a test script generated by the test virtual machine to the target virtual machine so as to test the target virtual machine according to the test script; and the determining module is used for determining the detection result of the target virtual machine according to the test response generated by the target virtual machine.
According to a third aspect of embodiments of the present invention, there is provided an electronic apparatus, including: a processor; and a memory having computer readable instructions stored thereon, the computer readable instructions, when executed by the processor, implementing the virtual machine performance detection method according to any one of the above.
According to a fourth aspect of embodiments of the present invention, there is provided a computer-readable storage medium on which a computer program is stored, the computer program, when executed by a processor, implementing the virtual machine performance detection method according to any one of the above.
The technical scheme provided by the embodiment of the invention can have the following beneficial effects:
in the technical solutions provided in some embodiments of the present invention, a test virtual machine is created through an operating system type, a first configuration parameter, and a second configuration parameter included in a request for creating the test virtual machine, a target virtual machine that meets a preset rule is determined according to the test virtual machine, a test script generated by the test virtual machine is sent to the target virtual machine and is tested, and a detection result of the target virtual machine is determined. On one hand, the target virtual machine is detected by creating the test virtual machine, manual participation is not needed, batch verification can be performed on the target virtual machine, the detection period is shortened, and the working efficiency is improved; on the other hand, the test script is determined according to the configuration parameters of the test virtual machine, and the corresponding account password is acquired by the test virtual machine to log in the target virtual machine so as to test the target virtual machine, so that the condition of virtual machine locking caused by input error of the account password is avoided, and the quality and efficiency of the test process are improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention, as claimed.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention. It is obvious that the drawings in the following description are only some embodiments of the invention, and that for a person skilled in the art, other drawings can be derived from them without inventive effort. In the drawings:
FIG. 1 schematically illustrates a schematic diagram of a virtual machine performance detection method according to some embodiments of the invention;
FIG. 2 schematically illustrates a diagram of determining a target virtual machine according to preset rules, in accordance with some embodiments of the present invention;
FIG. 3 is a schematic diagram that schematically illustrates sending a test script, in accordance with further embodiments of the present invention;
FIG. 4 schematically illustrates a schematic diagram of a virtual machine performance detection apparatus according to some embodiments of the invention;
FIG. 5 schematically illustrates a schematic view of a test module according to some embodiments of the invention;
FIG. 6 schematically illustrates a schematic diagram of a computer system architecture of an electronic device, in accordance with some embodiments of the present invention;
FIG. 7 schematically illustrates a schematic diagram of a computer-readable storage medium according to some embodiments of the invention.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to provide a thorough understanding of embodiments of the invention. One skilled in the relevant art will recognize, however, that the invention may be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known methods, devices, implementations or operations have not been shown or described in detail to avoid obscuring aspects of the invention.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.
In an exemplary embodiment of the present invention, a virtual machine performance detection method is first provided, and fig. 1 schematically illustrates a schematic diagram of a virtual machine performance detection method according to some embodiments of the present invention. Referring to fig. 1, the virtual machine performance detection method may include the following steps:
step S110, receiving a request for creating a test virtual machine, wherein the request for creating the test virtual machine comprises an operating system type, a first configuration parameter and a second configuration parameter of the test virtual machine;
step S120, a test virtual machine is established according to the first configuration parameter and the second configuration parameter;
step S130, based on the test virtual machine, determining a target virtual machine which accords with a preset rule from a preset virtual machine configuration table;
step S140, sending a test script generated by the test virtual machine to the target virtual machine so as to test the target virtual machine according to the test script;
and S150, determining the detection result of the target virtual machine according to the test response generated by the target virtual machine.
According to the performance detection method in the exemplary embodiment, on one hand, the target virtual machine is detected by creating the test virtual machine, manual participation is not needed, batch verification can be performed on the target virtual machine, the detection period is shortened, and the working efficiency is improved; on the other hand, the test script is determined according to the configuration parameters of the test virtual machine, and the corresponding account password is acquired by the test virtual machine to log in the target virtual machine so as to test the target virtual machine, so that the condition of virtual machine locking caused by input error of the account password is avoided, and the quality and efficiency of the test process are improved.
Next, the virtual machine performance detection method in the present exemplary embodiment will be further described.
In step S110, a request for creating a test virtual machine is received, where the request for creating a test virtual machine includes an operating system type, a first configuration parameter, and a second configuration parameter of the test virtual machine.
In an example embodiment of the present invention, a test virtual machine refers to a specific virtual machine that detects a target virtual machine through an associated command tool. The system receives a request for creating the test virtual machine sent by a system administrator, and obtains parameters such as the operating system type, the first configuration parameters and the second configuration parameters of the test virtual machine included in the request. And establishing a test virtual machine corresponding to the operating system according to the operating system type of the test virtual machine, for example, establishing the test virtual machine of a Linux system, and configuring the test virtual machine according to the first configuration parameter and the second configuration parameter. Of course, the parameters included in the request for creating the test virtual machine may also be other parameters, such as the number of cores of the CPU of the processor, the size of the memory, the size of the hard disk capacity, and the network segment information. And a test virtual machine corresponding to the operating system is created according to the operating system type in the creation request, and a proper operating system can be selected according to the actual situation, so that the stability of the test virtual machine is improved, and the safety of the test environment is ensured.
It should be noted that the terms "first", "second", and the like, are used herein only for distinguishing configuration parameters of different tools for testing the virtual machine, and should not impose any limitation on the present disclosure.
In step S120, a test virtual machine is created according to the first configuration parameter and the second configuration parameter.
In an example embodiment of the present invention, the first configuration parameter may refer to a configuration parameter related to communication of a preset virtual machine, such as a WinRM module. The second configuration parameter may refer to a relevant configuration parameter written by a preset virtual machine implementation scripting tool, for example, a scripting language Python, a Pip software package, and the like.
In an example embodiment of the present invention, the communication tool of the test virtual machine is configured by the first configuration parameter, and the communication tool may refer to a necessary tool for enabling the test virtual machine to remotely test the target virtual machine. And configuring a script writing tool of the test virtual machine through the second configuration parameter, wherein the script writing tool can be a tool for editing a test script for realizing the automatic communication performance verification process of the target virtual machine by the test virtual machine. And creating a test virtual machine according to the configured communication tool, the script writing tool and other related configuration parameters, wherein the communication tool and the script writing tool are stored in a physical machine corresponding to the test virtual machine.
In step S130, based on the test virtual machine, a target virtual machine meeting a preset rule is determined from a preset virtual machine configuration table.
In an example embodiment of the present invention, the target virtual machine may refer to a virtual machine to be tested, which needs to perform a communication performance test in a preset virtual machine configuration table. The virtual machine configuration table may include information of at least one virtual machine, and the information of each virtual machine may include identification information of the virtual machine, a login account number, a login password, and an operating system type of the virtual machine. The preset rule may be that the target virtual machine is a virtual machine of a specific operating system, for example, a virtual machine of which the preset rule is that the operating system is Windows is taken as the target virtual machine. The preset rules may also include that the target virtual machine is configured with the relevant service, for example, the preset rules may be that the virtual machine is capable of executing Powershell remote management service. Of course, the preset rule may also be other types of rules, for example, the target virtual machine is configured with a WinRM module, etc., and the present invention is not limited in particular herein.
Referring to fig. 2, fig. 2 is a schematic diagram illustrating the determination of a target virtual machine according to a preset rule according to some embodiments of the present invention, which is described in detail below.
Step S210, obtaining a preset rule and a preset virtual machine configuration table on the physical machine corresponding to the test virtual machine.
In an example embodiment of the present invention, a physical machine refers to a physical device corresponding to a virtual machine, such as a computer or a server, and the physical machine provides a hardware environment for the virtual machine. The virtual machine configuration table comprises information such as an ID (identity), an operating system type, a login account and a login password of a target virtual machine, and the virtual machine configuration table and a preset rule are stored in a physical machine corresponding to the test virtual machine. And the test virtual machine acquires the stored virtual machine configuration table and the preset rule from the physical machine.
Step S220, filtering the virtual machines on the virtual machine configuration table according to the preset rule, and determining a target virtual machine that meets the preset rule.
In an exemplary embodiment of the present invention, the target virtual machine refers to a virtual machine that is selected by the test virtual machine from the target virtual machine list according to a preset rule and the virtual machine configuration table and meets the preset rule. And the test virtual machine filters the virtual machine configuration table according to the preset rule and determines the target virtual machine which accords with the preset rule. For example, a virtual machine with an operating system of Windows may be screened from the virtual machine configuration table, a login account and a login password of the selected virtual machine are obtained and logged in, various configurations of the virtual machine are checked, and filtering is performed again according to a preset rule to determine a target virtual machine that meets the preset rule.
In step S140, the test script generated by the test virtual machine is sent to the target virtual machine, so as to test the target virtual machine according to the test script.
In an example embodiment of the present invention, a test script may refer to a corresponding program written by a script writing tool according to an item that needs to be detected by a test virtual machine. The testing virtual machine acquires a login account and a login password of the target virtual machine from the virtual machine configuration table, and sends a login request to the target virtual machine according with the preset rule according to the communication tool, wherein the login request comprises the login account and the login password of the target virtual machine. When the test virtual machine receives the information that the target virtual machine successfully responds to login, a test script is generated according to a script writing tool of the test virtual machine, similarly, the test script is sent to the target virtual machine through a communication tool of the test virtual machine and executed, the test script starts to test related items of the communication performance of the target virtual machine, and a corresponding test log is generated.
Referring to FIG. 3, FIG. 3 schematically illustrates a diagram of sending a test script according to further embodiments of the present invention, which is described in detail below.
Step S310, distributing the sending task of the test script of the target virtual machine to at least two parallel threads in the plurality of parallel threads according to the number of the target virtual machines.
In an example embodiment of the present invention, a communication tool for testing a virtual machine includes a plurality of parallel threads. When the test script is sent to the target virtual machine meeting the predetermined rule through the communication tool of the test virtual machine, the sending task of sending the test script corresponding to the plurality of test commands is distributed to at least two parallel threads, for example, three parallel threads, of the plurality of parallel threads, or other numbers of parallel threads, which is not limited herein. The test script is sent to the target virtual machine according to the sending tasks distributed by the at least two parallel threads, so that the workload of the test virtual machine when the target virtual machine is more can be relieved, the period of detection and verification can be shortened, and the working efficiency of detection of the test virtual machine can be improved.
Step S320, sending the test script to the corresponding target virtual machine based on the sending task of the test script of the at least two parallel threads.
In an exemplary embodiment of the present invention, there are a plurality of target virtual machines screened by the test virtual machine according to the preset rule, and the sending task of each test script only corresponds to the currently determined target virtual machine. The system determines the number of parallel threads to be assigned to send tasks based on the number of target virtual machines that meet predetermined rules. For example according to formula (1):
Figure BDA0001984745840000091
in the formula (1), N represents the number of parallel threads for distributing sending tasks, M represents the number of target virtual machines meeting a preset rule, k represents a preset value which is a constant determined by a system administrator according to actual conditions, wherein N and M are positive integers, and the sending tasks of the test scripts of the M target virtual machines are distributed to the N parallel threads by the test virtual machine. And sending the test script to the target virtual machine according to the determined N parallel threads of the communication tool. The number of the parallel threads for distributing tasks is determined according to the number of the target virtual machines, and the working efficiency of the testing virtual machines can be further improved.
In step S150, a detection result of the target virtual machine is determined according to the test response generated by the target virtual machine.
In an example embodiment of the present invention, after the test virtual machine sends the test script to the target virtual machine, a test response returned by the target virtual machine is received. And the test virtual machine acquires a corresponding relation table of the test response and the detection result, wherein the corresponding relation table comprises the test command in the test script and the test response and the detection result corresponding to the test command. And the test virtual machine determines the detection result of the test script according to the test response and the corresponding relation table, namely the final detection result of the communication performance of the test virtual machine detection target virtual machine.
It should be noted that although the steps of the method of the present invention are depicted in the drawings in a particular order, this does not require or imply that the steps must be performed in this particular order or that all of the depicted steps must be performed to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions, etc.
In addition, in this example embodiment, an apparatus for detecting performance of a virtual machine is also provided. Referring to fig. 4, the performance detection apparatus 400 includes: the receiving module 410 is configured to receive a request for creating a test virtual machine, where the request for creating the test virtual machine includes an operating system type, a first configuration parameter, and a second configuration parameter of the test virtual machine; the creating module 420 is configured to create a test virtual machine according to the first configuration parameter and the second configuration parameter; the screening module 430 is configured to determine, based on the test virtual machine, a target virtual machine meeting a preset rule from a preset virtual machine configuration table; the test module 440 is configured to send a test script generated by the test virtual machine to the target virtual machine, so as to test the target virtual machine according to the test script; the determining module 450 is configured to determine a detection result of the target virtual machine according to the test response generated by the target virtual machine.
In an exemplary embodiment of the invention, based on the foregoing, the creation module 420 is configured to: determining a communication tool of the test virtual machine according to the first configuration parameter; determining a script writing tool of the test virtual machine according to the second configuration parameter; creating the test virtual machine based on the communication tool and the scripting tool.
In an exemplary embodiment of the present invention, based on the foregoing scheme, the screening module 430 is configured to: acquiring a preset rule and a virtual machine configuration table stored on a physical machine corresponding to the test virtual machine; and filtering the virtual machines in the virtual machine configuration table according to the preset rule, and determining the virtual machines meeting the preset rule as target virtual machines.
Referring to fig. 5, fig. 5 schematically illustrates a schematic diagram of a test module, according to some embodiments of the invention, the test module 440 comprising: the generating unit 510 is configured to generate a test script according to the preset virtual machine configuration table and a script writing tool of the test virtual machine; the test unit 520 is configured to send the test script to the target virtual machine through a communication tool of the test virtual machine, so as to test the target virtual machine according to the test script.
In an exemplary embodiment of the invention, based on the foregoing solution, the communication tool comprises a plurality of parallel threads, the test unit 520 is configured to: distributing sending tasks of a test script of the target virtual machine to at least two parallel threads in the plurality of parallel threads according to the number of the target virtual machines; and sending the test script to the determined target virtual machine based on the sending tasks of the test scripts of the at least two parallel threads.
In an exemplary embodiment of the present invention, based on the foregoing, the test module 440 is configured to: sending a login request to the target virtual machine through a communication tool of the test virtual machine; the login request comprises a login account and a login password of the target virtual machine; and responding to successful login of the target virtual machine, and sending a test script generated by the test virtual machine to the target virtual machine so as to test the target virtual machine according to the test script.
In an exemplary embodiment of the invention, based on the foregoing, the determining module 450 is configured to: obtaining a test response generated by the target virtual machine executing the test script; and determining a test result corresponding to the test response of the target virtual machine according to a preset corresponding relation table of the test response and the test result.
The specific details of each module of the above virtual machine performance detection apparatus have been described in detail in the corresponding virtual machine performance detection method, and therefore are not described herein again.
It should be noted that although several modules or units of the virtual machine performance detection apparatus are mentioned in the above detailed description, such division is not mandatory. Indeed, the features and functions of two or more modules or units described above may be embodied in one module or unit according to an embodiment of the invention. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
In addition, in an exemplary embodiment of the present disclosure, an electronic device capable of implementing the virtual machine performance detection method is also provided.
As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as a system, method or program product. Accordingly, various aspects of the present invention may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
An electronic device 600 according to such an embodiment of the invention is described below with reference to fig. 6. The electronic device 600 shown in fig. 6 is only an example and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 6, the electronic device 600 is in the form of a general purpose computing device. The components of the electronic device 600 may include, but are not limited to: the at least one processing unit 610, the at least one memory unit 620, a bus 630 connecting different system components (including the memory unit 620 and the processing unit 610), and a display unit 640.
Wherein the storage unit stores program code that is executable by the processing unit 610 such that the processing unit 610 performs the steps according to various exemplary embodiments of the present invention as described in the above section "exemplary method" of the present specification. For example, the processing unit 610 may execute step S110 shown in fig. 1, and receive a request for creating a test virtual machine, where the request for creating the test virtual machine includes an operating system type, a first configuration parameter, and a second configuration parameter of the test virtual machine; step S120, a test virtual machine is established according to the first configuration parameter and the second configuration parameter; step S130, based on the test virtual machine, determining a target virtual machine which accords with a preset rule from a preset virtual machine configuration table; step S140, sending a test script generated by the test virtual machine to the target virtual machine so as to test the target virtual machine according to the test script; and S150, determining the detection result of the target virtual machine according to the test response generated by the target virtual machine.
The storage unit 620 may include readable media in the form of volatile memory units, such as a random access memory unit (RAM) 621 and/or a cache memory unit 622, and may further include a read only memory unit (ROM) 623.
The storage unit 620 may also include a program/utility 624 having a set (at least one) of program modules 625, such program modules 625 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination thereof may comprise an implementation of a network environment.
Bus 630 can be any bus representing one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 600 may also communicate with one or more external devices 670 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 600, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 600 to communicate with one or more other computing devices. Such communication may occur via an input/output (I/O) interface 650. Also, the electronic device 600 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the Internet) via the network adapter 660. As shown, the network adapter 660 communicates with the other modules of the electronic device 600 over the bus 630. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, to name a few.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
In an exemplary embodiment of the present disclosure, there is also provided a computer-readable storage medium having stored thereon a program product capable of implementing the above-described method of the present specification. In some possible embodiments, aspects of the invention may also be implemented in the form of a program product comprising program code means for causing a terminal device to carry out the steps according to various exemplary embodiments of the invention described in the above-mentioned "exemplary methods" section of the present description, when said program product is run on the terminal device.
Referring to fig. 7, a program product 700 for implementing the above-described virtual machine performance detection method according to an embodiment of the present invention is described, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited in this regard and, in the present document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
Furthermore, the above-described figures are merely schematic illustrations of processes involved in methods according to exemplary embodiments of the invention, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed, for example, synchronously or asynchronously in multiple modules.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiment of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiment of the present disclosure.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice in the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (6)

1. A virtual machine performance detection method is characterized by comprising the following steps:
receiving a request for creating a test virtual machine, wherein the request for creating the test virtual machine comprises an operating system type, a first configuration parameter and a second configuration parameter of the test virtual machine;
configuring a communication tool of the test virtual machine through the first configuration parameter, and configuring a script writing tool of the test virtual machine through the second configuration parameter; creating the test virtual machine corresponding to the operating system according to the type of the operating system; creating the test virtual machine based on the communication tool and the script writing tool; the communication tool and the script writing tool are stored in a physical machine corresponding to the test virtual machine;
determining a target virtual machine which accords with a preset rule from a preset virtual machine configuration table based on the test virtual machine; the virtual machine configuration table comprises identification information, a login account, a login password and an operating system type of the virtual machine; the preset rules comprise the virtual machine with a specific operating system and the virtual machine configured with a specific service; the determining a target virtual machine meeting a preset rule from a preset virtual machine configuration table includes: screening out a virtual machine with an operating system as the specific operating system from the virtual machine configuration table, simultaneously acquiring the login account and the login password of the selected virtual machine, logging in, checking various configurations of the virtual machine, and filtering again according to preset rules to determine the target virtual machine which accords with the preset rules;
sending a login request to the target virtual machine through a communication tool of the test virtual machine; the login request comprises a login account and a login password of the target virtual machine; responding to successful login of the target virtual machine, triggering to send a test script generated by the test virtual machine to the target virtual machine, and testing the target virtual machine according to the test script; the method comprises the following steps: generating a test script according to the preset virtual machine configuration table and a script writing tool of the test virtual machine; sending the test script to a target virtual machine through a communication tool of the test virtual machine so as to test the target virtual machine according to the test script;
determining a detection result of the target virtual machine according to the test response generated by the target virtual machine;
wherein the communication tool comprises a plurality of parallel threads, and the sending the test script generated by the test virtual machine to the target virtual machine comprises: distributing sending tasks of the test scripts generated by the test virtual machines to at least two parallel threads in the multiple parallel threads according to the number of the target virtual machines; and sending the test script to the corresponding target virtual machine according to the sending tasks of the test script of at least two parallel threads.
2. The method for detecting performance of a virtual machine according to claim 1, wherein the determining, based on the test virtual machine, a target virtual machine that meets a preset rule from a preset virtual machine configuration table includes:
acquiring a preset rule and a preset virtual machine configuration table stored on a physical machine corresponding to the test virtual machine;
and filtering the virtual machines in the preset virtual machine configuration table according to the preset rule, and determining the virtual machines meeting the preset rule as target virtual machines.
3. The method for detecting performance of a virtual machine according to claim 1, wherein the determining a detection result of the target virtual machine according to the test response generated by the target virtual machine includes:
obtaining a test response generated by the target virtual machine executing the test script;
and determining a detection result corresponding to the test response of the target virtual machine according to a preset corresponding relation table of the test response and the detection result.
4. A virtual machine performance detection apparatus, comprising:
the virtual machine testing system comprises a receiving module, a testing module and a processing module, wherein the receiving module is used for receiving a request for creating a testing virtual machine, and the request for creating the testing virtual machine comprises an operating system type, a first configuration parameter and a second configuration parameter of the testing virtual machine;
the creating module is used for configuring a communication tool of the test virtual machine through the first configuration parameter and configuring a script writing tool of the test virtual machine through the second configuration parameter; creating the test virtual machine corresponding to the operating system according to the type of the operating system; creating the test virtual machine based on the communication tool and the script writing tool; the communication tool and the script writing tool are stored in a physical machine corresponding to the test virtual machine;
the screening module is used for determining a target virtual machine which accords with a preset rule from a preset virtual machine configuration table based on the test virtual machine; the virtual machine configuration table comprises identification information, a login account number, a login password and an operating system type of the virtual machine; the preset rules comprise the virtual machine with a specific operating system and the virtual machine configured with a specific service; the determining a target virtual machine meeting a preset rule from a preset virtual machine configuration table includes: screening out a virtual machine with an operating system as the specific operating system from the virtual machine configuration table, simultaneously acquiring the login account and the login password of the selected virtual machine, logging in, checking various configurations of the virtual machine, and filtering again according to preset rules to determine the target virtual machine which accords with the preset rules;
the testing module is used for sending a login request to the target virtual machine through a communication tool of the testing virtual machine; the login request comprises a login account and a login password of the target virtual machine; responding to successful login of the target virtual machine, triggering to send a test script generated by the test virtual machine to the target virtual machine, and testing the target virtual machine according to the test script; the method comprises the following steps: generating a test script according to the preset virtual machine configuration table and a script writing tool of the test virtual machine; sending the test script to a target virtual machine through a communication tool of the test virtual machine so as to test the target virtual machine according to the test script;
the determining module is used for determining a detection result of the target virtual machine according to the test response generated by the target virtual machine;
wherein the communication tool comprises a plurality of parallel threads, and the sending the test script generated by the test virtual machine to the target virtual machine comprises: distributing sending tasks of the test scripts generated by the test virtual machines to at least two parallel threads in the multiple parallel threads according to the number of the target virtual machines; and sending the test script to the corresponding target virtual machine according to the sending tasks of the test script of at least two parallel threads.
5. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out a virtual machine performance detection method according to any one of claims 1 to 3.
6. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the virtual machine performance detection method of any of claims 1 to 3.
CN201910161318.0A 2019-03-04 2019-03-04 Virtual machine performance detection method and device, electronic equipment and storage medium Active CN110058920B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910161318.0A CN110058920B (en) 2019-03-04 2019-03-04 Virtual machine performance detection method and device, electronic equipment and storage medium
PCT/CN2019/118021 WO2020177385A1 (en) 2019-03-04 2019-11-13 Virtual machine function detection method and apparatus, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910161318.0A CN110058920B (en) 2019-03-04 2019-03-04 Virtual machine performance detection method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110058920A CN110058920A (en) 2019-07-26
CN110058920B true CN110058920B (en) 2023-01-31

Family

ID=67316582

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910161318.0A Active CN110058920B (en) 2019-03-04 2019-03-04 Virtual machine performance detection method and device, electronic equipment and storage medium

Country Status (2)

Country Link
CN (1) CN110058920B (en)
WO (1) WO2020177385A1 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110058920B (en) * 2019-03-04 2023-01-31 平安科技(深圳)有限公司 Virtual machine performance detection method and device, electronic equipment and storage medium
CN112765007A (en) * 2019-10-21 2021-05-07 腾讯科技(深圳)有限公司 Integration test method, device and storage medium
CN111090641B (en) * 2019-11-25 2024-04-02 医渡云(北京)技术有限公司 Data processing method and device, electronic equipment and storage medium
CN111078539B (en) * 2019-11-29 2022-09-06 江苏苏宁物流有限公司 Test method, device, system and computer readable storage medium
CN115150298B (en) * 2021-03-31 2023-11-03 北京金山云网络技术有限公司 Virtual gateway testing method and device, storage medium and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107092541A (en) * 2017-04-27 2017-08-25 郑州云海信息技术有限公司 A kind of method that utilization virtual machine carries out storage performance test
CN107168880A (en) * 2017-05-31 2017-09-15 中标软件有限公司 Virtual machine method of testing and instrument
CN107302475A (en) * 2017-07-06 2017-10-27 郑州云海信息技术有限公司 The method of testing and device of a kind of Based on Distributed storage cluster
CN107395456A (en) * 2017-07-18 2017-11-24 郑州云海信息技术有限公司 Distributed file system stream directly deposits method of testing and platform
CN108900324A (en) * 2018-06-13 2018-11-27 平安科技(深圳)有限公司 Verify the method and device of virtual machine communication performance

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9910764B2 (en) * 2013-06-24 2018-03-06 Linkedin Corporation Automated software testing
CN106919485B (en) * 2017-03-09 2020-02-07 苏州浪潮智能科技有限公司 System based on hardware testing tool configured on server
CN107704395B (en) * 2017-10-24 2020-07-07 武大吉奥信息技术有限公司 Cloud platform automation test implementation method and system based on Openstack
CN110058920B (en) * 2019-03-04 2023-01-31 平安科技(深圳)有限公司 Virtual machine performance detection method and device, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107092541A (en) * 2017-04-27 2017-08-25 郑州云海信息技术有限公司 A kind of method that utilization virtual machine carries out storage performance test
CN107168880A (en) * 2017-05-31 2017-09-15 中标软件有限公司 Virtual machine method of testing and instrument
CN107302475A (en) * 2017-07-06 2017-10-27 郑州云海信息技术有限公司 The method of testing and device of a kind of Based on Distributed storage cluster
CN107395456A (en) * 2017-07-18 2017-11-24 郑州云海信息技术有限公司 Distributed file system stream directly deposits method of testing and platform
CN108900324A (en) * 2018-06-13 2018-11-27 平安科技(深圳)有限公司 Verify the method and device of virtual machine communication performance

Also Published As

Publication number Publication date
WO2020177385A1 (en) 2020-09-10
CN110058920A (en) 2019-07-26

Similar Documents

Publication Publication Date Title
CN110058920B (en) Virtual machine performance detection method and device, electronic equipment and storage medium
US9386079B2 (en) Method and system of virtual desktop infrastructure deployment studio
CN109388569B (en) Method for remotely detecting environmental anomaly of client, test server and storage medium
CN106919485B (en) System based on hardware testing tool configured on server
US9411711B2 (en) Adopting an existing automation script to a new framework
CN110673936B (en) Breakpoint continuous operation method and device for arrangement service, storage medium and electronic equipment
CN103973515A (en) Network card stability testing method
US10169205B2 (en) Automated system testing in a complex software environment
CN111767241B (en) PCIe fault injection test method, device and storage medium
CN106557878B (en) Development project management method and device
CN111258913A (en) Automatic algorithm testing method and device, computer system and readable storage medium
US20160378521A1 (en) Automated test optimization
CN112650676A (en) Software testing method, device, equipment and storage medium
US20160112285A1 (en) Apparatus and method for detecting abnormal connection
US10430322B2 (en) Testing pre and post system call exits
US10725894B2 (en) Measuring and improving test coverage
CN106886477B (en) Method and device for setting monitoring threshold in cloud system
CN110609786A (en) Software testing method and device, computer equipment and storage medium
US11711261B2 (en) Automated host management service
CN115454576A (en) Virtual machine process management method and system and electronic equipment
US11294804B2 (en) Test case failure with root cause isolation
CN114969175A (en) Method for butting insurance platform and external system and related equipment
CN112631929A (en) Test case generation method and device, storage medium and electronic equipment
CN114626053A (en) Testing method and device for national secret authentication, national secret authentication program and system
JP2014106912A (en) Constraint extraction program, constraint extraction device and constraint extraction method

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
GR01 Patent grant
GR01 Patent grant