CN113467893A - Virtual machine automation test method and device, storage medium and processor - Google Patents

Virtual machine automation test method and device, storage medium and processor Download PDF

Info

Publication number
CN113467893A
CN113467893A CN202110797831.6A CN202110797831A CN113467893A CN 113467893 A CN113467893 A CN 113467893A CN 202110797831 A CN202110797831 A CN 202110797831A CN 113467893 A CN113467893 A CN 113467893A
Authority
CN
China
Prior art keywords
virtual machine
upgraded
software version
target virtual
target
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
CN202110797831.6A
Other languages
Chinese (zh)
Other versions
CN113467893B (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.)
Hillstone Networks Co Ltd
Original Assignee
Hillstone Networks 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 Hillstone Networks Co Ltd filed Critical Hillstone Networks Co Ltd
Priority to CN202110797831.6A priority Critical patent/CN113467893B/en
Publication of CN113467893A publication Critical patent/CN113467893A/en
Application granted granted Critical
Publication of CN113467893B publication Critical patent/CN113467893B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/368Test management for test version control, e.g. updating test cases to a new software version
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Stored Programmes (AREA)

Abstract

The application discloses a virtual machine automation test method, a virtual machine automation test device, a storage medium and a processor. The method comprises the following steps: acquiring a virtualization software version to be upgraded based on a pre-configured IP address in a target virtual machine; triggering an upgrade request of a virtualized software version to be upgraded; responding to the upgrading request, and executing upgrading processing on the virtualized software version to be upgraded to obtain the upgraded virtualized software version; and testing the upgraded virtualization software version. By the method and the device, the problems that in the related art, due to the fact that the system cannot automatically acquire the virtualization version to be upgraded, subsequent virtualization versions are upgraded, and testing efficiency is low are solved.

Description

Virtual machine automation test method and device, storage medium and processor
Technical Field
The application relates to the technical field of software testing, in particular to a virtual machine automation testing method and device, a storage medium and a processor.
Background
With the continuous development of scientific technology, the role of computer virtual machine technology in work is more and more important. Among the software versions introduced by enterprises, virtualized versions have become an integral part.
The testing of a virtualized product often requires a lot of installation, upgrade and basic function verification work, and the following problems are often encountered by the testing workers in the work: the method comprises the steps of installing a virtual machine and upgrading a software version after installation, wherein the waiting time is long, the version needing to be upgraded and verified is more, the workload is large, basic function verification work is repeated after each upgrade, a testing worker usually writes a script to deploy the virtual machine in the release testing work of a virtualization product, then the IP, a target route and the like are manually configured on the deployed virtual machine, and finally, an interface or a web automatic testing tool is used for testing basic functions.
In the prior art, after the virtual deployment is finished, the IP is automatically configured for the virtual machine, so that the problem of manually configuring the IP is solved. However, since the method allocates the IP address by itself, the IP address of the virtual machine cannot be known after deployment is completed, and subsequent automatic upgrade and basic function verification cannot be performed automatically.
Aiming at the problems that the subsequent upgrading of the virtualization versions and the low testing efficiency are caused because the system can not automatically obtain the virtualization versions to be upgraded in the related technology, an effective solution is not provided at present.
Disclosure of Invention
The present application mainly aims to provide a method, an apparatus, a storage medium, and a processor for automatically testing a virtual machine, so as to solve the problems in the related art that the subsequent upgrade of a virtualization version and the low testing efficiency are caused by the fact that a system cannot automatically acquire a virtualization version to be upgraded.
In order to achieve the above object, according to one aspect of the present application, there is provided a virtual machine automation test method. The method comprises the following steps: acquiring a virtualization software version to be upgraded based on a pre-configured IP address in a target virtual machine; triggering an upgrade request of a virtualized software version to be upgraded; responding to the upgrading request, and executing upgrading processing on the virtualized software version to be upgraded to obtain an upgraded virtualized software version; and testing the upgraded virtualization software version.
Further, before acquiring the virtualized software version to be upgraded based on the IP address preconfigured in the target virtual machine, the method further includes: setting the content of the target virtual machine, and acquiring the target virtual machine with the set content; and deploying the target virtual machine after the content is set.
Further, the content of the target virtual machine is set, and the obtaining of the target virtual machine after the content is set includes: installing a target virtual machine in the ESxi based on the first target script; and setting the content of the target virtual machine based on the target file package, and acquiring the target virtual machine with the set content, wherein the set content comprises the name of the target virtual machine, the disk allocation of the target virtual machine and the target storage of the target virtual machine.
Further, deploying the target virtual machine after the content is set comprises: starting a power supply for deploying the target virtual machine; setting the deployment waiting time of the target virtual machine; and if the deployment waiting time is longer than the first preset time, determining that the target virtual machine deployment process is finished.
Further, after determining that the target virtual machine deployment process is finished, the method further includes: executing configuration operation on the target virtual machine based on the first target script to obtain a configured target virtual machine, wherein the configured target virtual machine at least comprises an IP address of the target virtual machine and a destination route of the target virtual machine; and acquiring the version of the virtualization software to be upgraded based on the pre-configured IP address in the target virtual machine.
Further, triggering an upgrade request for a virtualized software version to be upgraded includes: calling a target testing tool to log in a target browser interface; and triggering an upgrade request of the virtualized software version to be upgraded based on the target browser interface.
Further, in response to the upgrade request, executing upgrade processing on the virtualized software version to be upgraded, and obtaining the upgraded virtualized software version includes: acquiring system interface information of a virtualized software version to be upgraded based on a target browser interface; executing the upgrading request operation of the virtualized software version to be upgraded based on the system interface information, and setting upgrading waiting time; and if the upgrade waiting time is longer than the second preset time, determining that the upgrade of the virtualization software version is finished, and acquiring the upgraded virtualization software version.
Further, before testing the upgraded virtualized software version, the method further includes: judging whether the virtualization software version is upgraded successfully; and if the virtualization software version is successfully upgraded, testing the upgraded virtualization software version.
In order to achieve the above object, according to another aspect of the present application, there is provided a virtual machine automation test apparatus. The device includes: the first acquisition unit is used for acquiring a virtualization software version to be upgraded based on an IP address pre-configured in a target virtual machine; the first trigger unit is used for triggering an upgrading request of a virtualized software version to be upgraded; the first execution unit is used for responding to the upgrading request and executing upgrading processing on the virtualized software version to be upgraded to obtain the upgraded virtualized software version; and the first testing unit is used for testing the upgraded virtualization software version.
Further, the apparatus further comprises: the first setting unit is used for setting the content of the target virtual machine before acquiring the version of the virtualization software to be upgraded based on the IP address pre-configured in the target virtual machine, and acquiring the target virtual machine after the content is set; and the first deployment unit is used for deploying the target virtual machine after the content is set.
Further, the first setting unit includes: the first installation module is used for installing the target virtual machine in the ESxi based on the first target script; the first obtaining module is used for setting the content of the target virtual machine based on the target file package and obtaining the target virtual machine with the set content, wherein the set content comprises the name of the target virtual machine, the disk allocation of the target virtual machine and the target storage of the target virtual machine.
Further, the first deployment unit includes: the first starting module is used for starting a power supply for deploying the target virtual machine; the first setting module is used for setting the deployment waiting time of the target virtual machine; and the first determining module is used for determining that the target virtual machine deployment process is finished if the deployment waiting time is longer than a first preset time.
Further, the apparatus further comprises: the second obtaining unit is used for executing configuration operation on the target virtual machine based on the first target script after the target virtual machine deployment process is determined to be finished, and obtaining the configured target virtual machine, wherein the configured target virtual machine at least comprises an IP address of the target virtual machine and a destination route of the target virtual machine; and the third acquisition unit is used for acquiring the version of the virtualization software to be upgraded based on the IP address pre-configured in the target virtual machine.
Further, the first trigger unit includes: the first calling module is used for calling a target testing tool to log in a target browser interface; and the first triggering module is used for triggering an upgrading request of the virtualization software version to be upgraded based on the target browser interface.
Further, the first execution unit includes: the second acquisition module is used for acquiring system interface information of the virtualization software version to be upgraded based on the target browser interface; the first execution module is used for executing the upgrading request operation of the virtualized software version to be upgraded based on the system interface information and setting the upgrading waiting time; and the second determining module is used for determining that the upgrading of the virtualization software version is finished and acquiring the upgraded virtualization software version if the upgrading waiting time is longer than a second preset time length.
Further, the apparatus further comprises: the first judgment unit is used for judging whether the virtualization software version is upgraded successfully or not before testing the upgraded virtualization software version; and the second testing unit is used for testing the upgraded virtualization software version if the virtualization software version is upgraded successfully.
According to another aspect of the embodiments of the present application, there is also provided a processor, configured to execute a program, where the program executes the virtual machine automation testing method according to any one of the above.
According to another aspect of the embodiments of the present application, there is also provided a storage medium having stored thereon a computer program/instruction, which when executed by a processor, performs the virtual machine automation testing method of any one of the above.
Through the application, the following steps are adopted: acquiring a virtualization software version to be upgraded based on a pre-configured IP address in a target virtual machine; triggering an upgrade request of a virtualized software version to be upgraded; responding to the upgrading request, and executing upgrading processing on the virtualized software version to be upgraded to obtain an upgraded virtualized software version; and testing the upgraded virtualization software version. The problem that due to the fact that a system cannot automatically acquire the virtualization version to be upgraded, subsequent virtualization version upgrading and testing efficiency are low in the related technology is solved, the virtualization software version to be upgraded is acquired based on the IP address pre-configured in the target virtual machine, then the system can automatically perform subsequent automatic upgrading and basic function verification work, and the effect of improving the virtualization version upgrading and testing efficiency is achieved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this application, illustrate embodiments of the application and, together with the description, serve to explain the application and are not intended to limit the application. In the drawings:
fig. 1 is a flowchart of a virtual machine automation test method provided according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating a system implementation of a method for testing a virtual machine in an automated manner according to an embodiment of the present disclosure; and
fig. 3 is a schematic diagram of a virtual machine automation test device provided according to an embodiment of the present application.
Detailed Description
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used may be interchanged under appropriate circumstances such that embodiments of the application described herein may be used. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, software version, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, software version, or apparatus.
For convenience of description, some terms or expressions referred to in the embodiments of the present application are explained below:
ova: open Virtualization Format, which is a virtual machine package.
ovf: open Virtualization application, an Open Virtualization device, is a virtual machine package.
PowerShell: the cross-platform task automation solution is composed of a command line shell, a scripting language and a configuration management framework.
PowerCLI: the Windows PowerShell plug-in is distributed as a powerful command line tool and can automatically execute various aspects of vSphere management.
cmd: a command line prompt.
bat: suffix name of Windows batch script.
ESxi: the virtual host platform has the advantages of high-level resource management function, high efficiency and flexibility.
ps 1: a script file written by PowerShell.
Selenium: a tool for Web application testing.
According to the embodiment of the application, an automatic testing method for the virtual machine is provided.
Fig. 1 is a flowchart of a virtual machine automation test method according to an embodiment of the present application. As shown in fig. 1, the method comprises the steps of:
step S101, acquiring a virtualization software version to be upgraded based on an IP address pre-configured in a target virtual machine.
Fig. 2 is a system execution flowchart of the virtual machine automation test method provided in the embodiment of the present application, and as shown in fig. 2, a target virtual machine needs to be deployed and configured before a virtualization software version is obtained.
Optionally, in the method for testing automation of a virtual machine provided in the embodiment of the present application, before acquiring a version of virtualized software to be upgraded based on an IP address preconfigured in a target virtual machine, the method further includes: setting the content of the target virtual machine, and acquiring the target virtual machine with the set content; and deploying the target virtual machine after the content is set.
Specifically, before setting and installing and deploying the content of the target virtual machine, the system needs to build an installation environment of the target virtual machine in advance, in the application, firstly, a PowerCLI is installed in a PowerShell under a Windows environment, a Selenium page automation environment is configured in the same Windows, installation of an ESXi server is achieved, and then whether a VMware-Tools tool is contained in an ova file or not is confirmed. If the VMware-Tools are not included, installing the VMware-Tools in the iso file, then exporting an ova file packet with the VMware-Tools, decompressing an ova folder to obtain ovf, vmdk and mf files, and setting the content of the target virtual machine after the establishment of the installation environment of the target virtual machine is finished.
Optionally, in the method for automatically testing a virtual machine provided in the embodiment of the present application, the setting of the content is performed on the target virtual machine, and the obtaining of the target virtual machine after the content is set includes: installing a target virtual machine in the ESxi based on the first target script; and setting the content of the target virtual machine based on the target file package, and acquiring the target virtual machine with the set content, wherein the set content comprises the name of the target virtual machine, the disk allocation of the target virtual machine and the target storage of the target virtual machine.
As shown in fig. 2, after the bat script is run based on the Cmd command, the bat script calls a PowerShell to execute a ps1 script and successfully connects to an ESXi server, obtains an ova folder based on an Import-vApp module and decompresses the ova folder to obtain a ovf file packet (corresponding to a target file packet in the present application), introduces the ovf packet into an environment where a target virtual machine is built to set the content of the target virtual machine, where the content of the target virtual machine includes the name of the target virtual machine, the disk allocation of the target virtual machine, and the target storage of the target virtual machine, and after the content of the target virtual machine is set, the target virtual machine needs to be deployed.
Optionally, in the method for automatically testing a virtual machine provided in the embodiment of the present application, deploying the target virtual machine after setting the content includes: starting a power supply for deploying the target virtual machine; setting the deployment waiting time of the target virtual machine; and if the deployment waiting time is longer than the first preset time, determining that the target virtual machine deployment process is finished.
For example, if the time required for deployment of the target virtual machine from start to end is 30min (corresponding to the first preset time duration in the present application), the system background sets the deployment waiting time of the target virtual machine to be 30min, and if it is detected that the deployment time of the target virtual machine exceeds 30min, it is proved that the deployment work of the target virtual machine has ended, and the deployment efficiency of the target virtual machine in the present application is improved by setting the first preset time duration.
Optionally, in the method for testing automation of a virtual machine provided in the embodiment of the present application, after determining that a target virtual machine deployment process is finished, the method further includes: executing configuration operation on the target virtual machine based on the first target script to obtain a configured target virtual machine, wherein the configured target virtual machine at least comprises an IP address of the target virtual machine and a destination route of the target virtual machine; and acquiring the version of the virtualization software to be upgraded based on the pre-configured IP address in the target virtual machine.
Specifically, the method and the device for upgrading the virtualization software version of the target virtual machine acquire the configured target virtual machine by calling the Invoke-VMScript function (corresponding to the first target script in the application) in the ps1 script and executing configuration operation on the IP address and the target route of the target virtual machine.
Step S102, triggering an upgrading request of the virtualized software version to be upgraded.
Specifically, after the target virtual machine is deployed, the to-be-upgraded virtualization software version is obtained based on the pre-configured IP address in the target virtual machine, wherein the to-be-upgraded virtualization software version is obtained by accessing the web interface of the target virtual machine.
Optionally, in the method for testing automation of a virtual machine provided in the embodiment of the present application, triggering an upgrade request of a virtualized software version to be upgraded includes: calling a target testing tool to log in a target browser interface; and triggering an upgrade request of the virtualized software version to be upgraded based on the target browser interface.
As shown in fig. 2, after the IP address and the destination route of the target virtual machine are determined, a Selenium testing tool (corresponding to the target testing tool in this application) is called to operate the target browser to open the web interface of the target virtual machine, and an upgrade request of the virtualized software version to be upgraded is triggered based on the target browser interface.
Step S103, responding to the upgrading request, and executing upgrading processing on the virtualized software version to be upgraded to obtain the upgraded virtualized software version.
As shown in fig. 2, after entering the web interface system of the target virtual machine, the virtualized software version upgrade request to be upgraded is executed.
Optionally, in the method for automatically testing a virtual machine provided in the embodiment of the present application, in response to the upgrade request, performing upgrade processing on a to-be-upgraded virtualization software version, and obtaining the upgraded virtualization software version includes: acquiring system interface information of a virtualized software version to be upgraded based on a target browser interface; executing the upgrading request operation of the virtualized software version to be upgraded based on the system interface information, and setting upgrading waiting time; and if the upgrade waiting time is longer than the second preset time, determining that the upgrade of the virtualization software version is finished, and acquiring the upgraded virtualization software version.
For example, based on a web interface of a target virtual machine, logging in system interface information of a virtualization software version to be upgraded, and executing an update operation on the virtualization software version to be upgraded, if the time required for upgrading the virtualization software version to be upgraded from the beginning to the end is 20min (corresponding to a second preset time duration in the present application), setting the upgrade waiting time of the virtualization software version to be upgraded to 20min by a system background, if it is detected that the upgrade time of the virtualization software version to be upgraded exceeds 20min, proving that the upgrade work of the virtualization software version to be upgraded has been ended, and by setting the second preset time duration, improving the upgrade efficiency of the virtualization software version in the present application.
And step S104, testing the upgraded virtualization software version.
As shown in fig. 2, before testing the upgraded virtualization software version, optionally, in the method for testing automation of a virtual machine provided in the embodiment of the present application, before testing the upgraded virtualization software version, the method further includes: judging whether the virtualization software version is upgraded successfully; and if the virtualization software version is successfully upgraded, testing the upgraded virtualization software version.
Specifically, if the upgrading of the virtualization software version is successful, a web automation function test is executed on the upgraded virtualization software version, a test result is recorded in the operation log, if the upgrading of the virtualization software version is failed, the web automation function test on the virtualization software version to be upgraded after failure is stopped, a verification result is recorded in the operation log, and therefore the follow-up log query is facilitated to know the reason of the upgrading failure of the virtualization software version. According to the method and the device, the testing efficiency of the upgraded virtualization software version is improved by judging whether the virtualization software version is upgraded successfully.
In summary, the method for automatically testing the virtual machine provided by the embodiment of the present application obtains the version of the virtualization software to be upgraded based on the IP address pre-configured in the target virtual machine; triggering an upgrade request of a virtualized software version to be upgraded; responding to the upgrading request, and executing upgrading processing on the virtualized software version to be upgraded to obtain an upgraded virtualized software version; and testing the upgraded virtualization software version. The problem that due to the fact that a system cannot automatically acquire the virtualization version to be upgraded, subsequent virtualization version upgrading and testing efficiency are low in the related technology is solved, the virtualization software version to be upgraded is acquired based on the IP address pre-configured in the target virtual machine, then the system can automatically perform subsequent automatic upgrading and basic function verification work, and the effect of improving the virtualization version upgrading and testing efficiency is achieved.
It should be noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer-executable instructions and that, although a logical order is illustrated in the flowcharts, in some cases, the steps illustrated or described may be performed in an order different than presented herein.
The embodiment of the present application further provides an automatic testing apparatus for a virtual machine, and it should be noted that the automatic testing apparatus for a virtual machine according to the embodiment of the present application can be used to execute the automatic testing method for a virtual machine according to the embodiment of the present application. The following describes an automated testing apparatus for a virtual machine according to an embodiment of the present application.
Fig. 3 is a schematic diagram of a virtual machine automation test device according to an embodiment of the application. As shown in fig. 3, the apparatus includes: a first obtaining unit 301, a first triggering unit 302, a first executing unit 303, and a first testing unit 304.
Specifically, the first obtaining unit 301 is configured to obtain a virtualized software version to be upgraded based on an IP address preconfigured in the target virtual machine;
a first triggering unit 302, configured to trigger an upgrade request of a virtualized software version to be upgraded;
a first executing unit 303, configured to respond to the upgrade request, execute upgrade processing on the virtualized software version to be upgraded, and obtain an upgraded virtualized software version;
a first testing unit 304, configured to test the upgraded virtualized software version.
To sum up, the automatic testing apparatus for a virtual machine provided in the embodiment of the present application is configured to, through the first obtaining unit 301, obtain a version of virtualization software to be upgraded based on an IP address pre-configured in a target virtual machine; a first triggering unit 302, configured to trigger an upgrade request of a virtualized software version to be upgraded; a first executing unit 303, configured to respond to the upgrade request, execute upgrade processing on the virtualized software version to be upgraded, and obtain an upgraded virtualized software version; the first testing unit 304 is configured to test the upgraded virtualization software version, and solve the problems that the subsequent virtualization version upgrading and the testing efficiency are low due to the fact that the system cannot automatically acquire the virtualization version to be upgraded in the related art.
Optionally, in the virtual machine automation test apparatus provided in the embodiment of the present application, the apparatus further includes: the first setting unit is used for setting the content of the target virtual machine before acquiring the version of the virtualization software to be upgraded based on the IP address pre-configured in the target virtual machine, and acquiring the target virtual machine after the content is set; and the first deployment unit is used for deploying the target virtual machine after the content is set.
Optionally, in the automatic testing apparatus for a virtual machine provided in an embodiment of the present application, the first setting unit includes: the first installation module is used for installing the target virtual machine in the ESxi based on the first target script; the first obtaining module is used for setting the content of the target virtual machine based on the target file package and obtaining the target virtual machine with the set content, wherein the set content comprises the name of the target virtual machine, the disk allocation of the target virtual machine and the target storage of the target virtual machine.
Optionally, in the automatic testing apparatus for a virtual machine provided in an embodiment of the present application, the first deployment unit includes: the first starting module is used for starting a power supply for deploying the target virtual machine; the first setting module is used for setting the deployment waiting time of the target virtual machine; and the first determining module is used for determining that the target virtual machine deployment process is finished if the deployment waiting time is longer than a first preset time.
Optionally, in the virtual machine automation test apparatus provided in the embodiment of the present application, the apparatus further includes: the second obtaining unit is used for executing configuration operation on the target virtual machine based on the first target script after the target virtual machine deployment process is determined to be finished, and obtaining the configured target virtual machine, wherein the configured target virtual machine at least comprises an IP address of the target virtual machine and a destination route of the target virtual machine; and the third acquisition unit is used for acquiring the version of the virtualization software to be upgraded based on the IP address pre-configured in the target virtual machine.
Optionally, in the virtual machine automation test apparatus provided in the embodiment of the present application, the first triggering unit 302 includes: the first calling module is used for calling a target testing tool to log in a target browser interface; and the first triggering module is used for triggering an upgrading request of the virtualization software version to be upgraded based on the target browser interface.
Optionally, in the virtual machine automation test apparatus provided in this embodiment of the present application, the first executing unit 303 includes: the second acquisition module is used for acquiring system interface information of the virtualization software version to be upgraded based on the target browser interface; the first execution module is used for executing the upgrading request operation of the virtualized software version to be upgraded based on the system interface information and setting the upgrading waiting time; and the second determining module is used for determining that the upgrading of the virtualization software version is finished and acquiring the upgraded virtualization software version if the upgrading waiting time is longer than a second preset time length.
Optionally, in the virtual machine automation test apparatus provided in the embodiment of the present application, the apparatus further includes: the first judgment unit is used for judging whether the virtualization software version is upgraded successfully or not before testing the upgraded virtualization software version; and the second testing unit is used for testing the upgraded virtualization software version if the virtualization software version is upgraded successfully.
The virtual machine automation testing device comprises a processor and a memory, wherein the first acquiring unit 301, the first triggering unit 302, the first executing unit 303, the first testing unit 304 and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can be set to be one or more, and the virtual machine automation test is carried out by adjusting the kernel parameters.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
The embodiment of the invention provides a storage medium, wherein a program is stored on the storage medium, and the program realizes the automatic testing method of a virtual machine when being executed by a processor.
The embodiment of the invention provides a processor, which is used for running a program, wherein the program executes an automatic test method of a virtual machine during running.
The embodiment of the invention provides equipment, which comprises a processor, a memory and a program which is stored on the memory and can run on the processor, wherein the processor executes the program and realizes the following steps: acquiring a virtualization software version to be upgraded based on a pre-configured IP address in a target virtual machine; triggering an upgrade request of a virtualized software version to be upgraded; responding to the upgrading request, and executing upgrading processing on the virtualized software version to be upgraded to obtain an upgraded virtualized software version; and testing the upgraded virtualization software version.
The processor executes the program and further realizes the following steps: before acquiring a virtualized software version to be upgraded based on an IP address pre-configured in a target virtual machine, setting the content of the target virtual machine, and acquiring the target virtual machine with the set content; and deploying the target virtual machine after the content is set.
The processor executes the program and further realizes the following steps: installing a target virtual machine in the ESxi based on the first target script; and setting the content of the target virtual machine based on the target file package, and acquiring the target virtual machine with the set content, wherein the set content comprises the name of the target virtual machine, the disk allocation of the target virtual machine and the target storage of the target virtual machine.
The processor executes the program and further realizes the following steps: starting a power supply for deploying the target virtual machine; setting the deployment waiting time of the target virtual machine; and if the deployment waiting time is longer than the first preset time, determining that the target virtual machine deployment process is finished.
The processor executes the program and further realizes the following steps: after the target virtual machine deployment process is determined to be finished, executing configuration operation on the target virtual machine based on the first target script, and acquiring the configured target virtual machine, wherein the configured target virtual machine at least comprises an IP address of the target virtual machine and a target route of the target virtual machine; and acquiring the version of the virtualization software to be upgraded based on the pre-configured IP address in the target virtual machine.
The processor executes the program and further realizes the following steps: calling a target testing tool to log in a target browser interface; and triggering an upgrade request of the virtualized software version to be upgraded based on the target browser interface.
The processor executes the program and further realizes the following steps: acquiring system interface information of a virtualized software version to be upgraded based on a target browser interface; executing the upgrading request operation of the virtualized software version to be upgraded based on the system interface information, and setting upgrading waiting time; and if the upgrade waiting time is longer than the second preset time, determining that the upgrade of the virtualization software version is finished, and acquiring the upgraded virtualization software version.
The processor executes the program and further realizes the following steps: before testing the upgraded virtualization software version, judging whether the virtualization software version is upgraded successfully; and if the virtualization software version is successfully upgraded, testing the upgraded virtualization software version.
The device herein may be a server, a PC, a PAD, a mobile phone, etc.
The present application also provides a computer program software version, which, when being executed on a data processing device, is adapted to carry out a program for initializing the following method steps: acquiring a virtualization software version to be upgraded based on a pre-configured IP address in a target virtual machine; triggering an upgrade request of a virtualized software version to be upgraded; responding to the upgrading request, and executing upgrading processing on the virtualized software version to be upgraded to obtain an upgraded virtualized software version; and testing the upgraded virtualization software version.
When executed on a data processing device, is further adapted to perform a procedure for initializing the following method steps: before acquiring a virtualized software version to be upgraded based on an IP address pre-configured in a target virtual machine, setting the content of the target virtual machine, and acquiring the target virtual machine with the set content; and deploying the target virtual machine after the content is set.
When executed on a data processing device, is further adapted to perform a procedure for initializing the following method steps: installing a target virtual machine in the ESxi based on the first target script; and setting the content of the target virtual machine based on the target file package, and acquiring the target virtual machine with the set content, wherein the set content comprises the name of the target virtual machine, the disk allocation of the target virtual machine and the target storage of the target virtual machine.
When executed on a data processing device, is further adapted to perform a procedure for initializing the following method steps: starting a power supply for deploying the target virtual machine; setting the deployment waiting time of the target virtual machine; and if the deployment waiting time is longer than the first preset time, determining that the target virtual machine deployment process is finished.
When executed on a data processing device, is further adapted to perform a procedure for initializing the following method steps: after the target virtual machine deployment process is determined to be finished, executing configuration operation on the target virtual machine based on the first target script, and acquiring the configured target virtual machine, wherein the configured target virtual machine at least comprises an IP address of the target virtual machine and a target route of the target virtual machine; and acquiring the version of the virtualization software to be upgraded based on the pre-configured IP address in the target virtual machine.
When executed on a data processing device, is further adapted to perform a procedure for initializing the following method steps: calling a target testing tool to log in a target browser interface; and triggering an upgrade request of the virtualized software version to be upgraded based on the target browser interface.
When executed on a data processing device, is further adapted to perform a procedure for initializing the following method steps: acquiring system interface information of a virtualized software version to be upgraded based on a target browser interface; executing the upgrading request operation of the virtualized software version to be upgraded based on the system interface information, and setting upgrading waiting time; and if the upgrade waiting time is longer than the second preset time, determining that the upgrade of the virtualization software version is finished, and acquiring the upgraded virtualization software version.
When executed on a data processing device, is further adapted to perform a procedure for initializing the following method steps: before testing the upgraded virtualization software version, judging whether the virtualization software version is upgraded successfully; and if the virtualization software version is successfully upgraded, testing the upgraded virtualization software version.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program software version. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a software version of a computer program embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program software versions according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program software version. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a software version of a computer program embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
The above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (11)

1. An automated testing method for a virtual machine, comprising:
acquiring a virtualization software version to be upgraded based on a pre-configured IP address in a target virtual machine;
triggering an upgrading request of the virtualization software version to be upgraded;
responding to the upgrading request, and executing the upgrading request on the virtualized software version to be upgraded to obtain the upgraded virtualized software version;
and testing the upgraded virtualization software version.
2. The method of claim 1, wherein prior to obtaining the virtualized software version to be upgraded based on a preconfigured IP address in the target virtual machine, the method further comprises:
setting the content of the target virtual machine, and acquiring the target virtual machine with the set content;
and deploying the target virtual machine after the content is set.
3. The method according to claim 2, wherein the content of the target virtual machine is set, and acquiring the target virtual machine after the content is set comprises:
installing the target virtual machine in ESxi based on a first target script;
and setting the content of the target virtual machine based on a target file package, and acquiring the target virtual machine with the set content, wherein the set content comprises the name of the target virtual machine, the disk allocation of the target virtual machine and the target storage of the target virtual machine.
4. The method of claim 3, wherein deploying the set-content target virtual machine comprises:
starting a power supply for deploying the target virtual machine;
setting the deployment waiting time of the target virtual machine;
and if the deployment waiting time is longer than a first preset time, determining that the target virtual machine deployment process is finished.
5. The method of claim 4, wherein after determining that the target virtual machine deployment process is complete, the method further comprises:
executing configuration operation on the target virtual machine based on the first target script to obtain a configured target virtual machine, wherein the configured target virtual machine at least comprises an IP address of the target virtual machine and a destination route of the target virtual machine;
and acquiring the version of the virtualization software to be upgraded based on the IP address in the target virtual machine.
6. The method of claim 1, wherein triggering an upgrade request for the virtualized software version to be upgraded comprises:
calling a target testing tool to log in a target browser interface;
and triggering an upgrading request of the virtualized software version to be upgraded based on the target browser interface.
7. The method of claim 6, wherein executing an upgrade request on the to-be-upgraded virtualization software version to obtain an upgraded virtualization software version comprises:
acquiring system interface information of the to-be-upgraded virtualized software version based on the target browser interface;
executing the upgrading request operation of the virtualized software version to be upgraded based on the system interface information, and setting upgrading waiting time;
and if the upgrade waiting time is longer than a second preset time length, determining that the upgrade of the virtualization software version is finished, and acquiring the upgraded virtualization software version.
8. The method of claim 1, wherein prior to testing the upgraded virtualized software version, the method further comprises:
judging whether the virtualization software version is upgraded successfully;
and if the virtualization software version is successfully upgraded, testing the upgraded virtualization software version.
9. An automated testing device for virtual machines, comprising:
the first acquisition unit is used for acquiring a virtualization software version to be upgraded based on an IP address pre-configured in a target virtual machine;
the first triggering unit is used for triggering an upgrading request of the virtualized software version to be upgraded;
the first execution unit is used for responding to the upgrading request and executing the upgrading request on the virtualized software version to be upgraded to obtain the upgraded virtualized software version;
and the first testing unit is used for testing the upgraded virtualization software version.
10. A processor, wherein the processor is configured to run a program, wherein the program is configured to execute the virtual machine automation test method of any one of claims 1 to 8 when the program is run.
11. A storage medium comprising a stored program, wherein the program executes the virtual machine automation test method of any one of claims 1 to 8.
CN202110797831.6A 2021-07-14 2021-07-14 Automatic testing method and device for virtual machine, storage medium and processor Active CN113467893B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110797831.6A CN113467893B (en) 2021-07-14 2021-07-14 Automatic testing method and device for virtual machine, storage medium and processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110797831.6A CN113467893B (en) 2021-07-14 2021-07-14 Automatic testing method and device for virtual machine, storage medium and processor

Publications (2)

Publication Number Publication Date
CN113467893A true CN113467893A (en) 2021-10-01
CN113467893B CN113467893B (en) 2024-02-02

Family

ID=77880318

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110797831.6A Active CN113467893B (en) 2021-07-14 2021-07-14 Automatic testing method and device for virtual machine, storage medium and processor

Country Status (1)

Country Link
CN (1) CN113467893B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114003421A (en) * 2021-10-22 2022-02-01 苏州浪潮智能科技有限公司 Virtual machine timeout mechanism testing method, system, terminal and storage medium

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120174095A1 (en) * 2011-01-04 2012-07-05 International Business Machines Corporation Automatically and securely configuring and updating virtual machines
CN102880482A (en) * 2012-08-06 2013-01-16 厦门市美亚柏科信息股份有限公司 System and technical method of automatically updating software in host batch control virtual machine
WO2013078548A1 (en) * 2011-12-02 2013-06-06 Groupe Iweb Inc. System and method for automatically configuring and updating a virtual server
CN103905239A (en) * 2012-12-30 2014-07-02 青岛海尔软件有限公司 Method for providing non-stop hot deployment for website system based on virtual machine technology
CN105740093A (en) * 2014-11-10 2016-07-06 财团法人资讯工业策进会 Backup Method, Pre-Testing Method For Environment Updating And System Thereof
CN105893115A (en) * 2016-04-05 2016-08-24 上海携程商务有限公司 Method and system for differential deployment of virtual machine
CN110275759A (en) * 2019-06-21 2019-09-24 长沙学院 A kind of virtual machine cluster dynamic deployment method
CN110286930A (en) * 2019-06-27 2019-09-27 腾讯科技(深圳)有限公司 A kind of cloud platform upgrade method, device, terminal and storage medium
CN112087516A (en) * 2020-09-10 2020-12-15 星辰天合(北京)数据科技有限公司 Storage upgrading method and device based on Docker virtualization technology
CN112241279A (en) * 2019-07-19 2021-01-19 广州汽车集团股份有限公司 Self-adaptive electronic control unit software upgrading method and system and automobile

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120174095A1 (en) * 2011-01-04 2012-07-05 International Business Machines Corporation Automatically and securely configuring and updating virtual machines
WO2013078548A1 (en) * 2011-12-02 2013-06-06 Groupe Iweb Inc. System and method for automatically configuring and updating a virtual server
CN102880482A (en) * 2012-08-06 2013-01-16 厦门市美亚柏科信息股份有限公司 System and technical method of automatically updating software in host batch control virtual machine
CN103905239A (en) * 2012-12-30 2014-07-02 青岛海尔软件有限公司 Method for providing non-stop hot deployment for website system based on virtual machine technology
CN105740093A (en) * 2014-11-10 2016-07-06 财团法人资讯工业策进会 Backup Method, Pre-Testing Method For Environment Updating And System Thereof
CN105893115A (en) * 2016-04-05 2016-08-24 上海携程商务有限公司 Method and system for differential deployment of virtual machine
CN110275759A (en) * 2019-06-21 2019-09-24 长沙学院 A kind of virtual machine cluster dynamic deployment method
CN110286930A (en) * 2019-06-27 2019-09-27 腾讯科技(深圳)有限公司 A kind of cloud platform upgrade method, device, terminal and storage medium
CN112241279A (en) * 2019-07-19 2021-01-19 广州汽车集团股份有限公司 Self-adaptive electronic control unit software upgrading method and system and automobile
CN112087516A (en) * 2020-09-10 2020-12-15 星辰天合(北京)数据科技有限公司 Storage upgrading method and device based on Docker virtualization technology

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
汪源;刘传昌;: "云计算环境下业务自动化部署的设计与实现", 软件, no. 09 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114003421A (en) * 2021-10-22 2022-02-01 苏州浪潮智能科技有限公司 Virtual machine timeout mechanism testing method, system, terminal and storage medium
CN114003421B (en) * 2021-10-22 2023-11-07 苏州浪潮智能科技有限公司 Virtual machine timeout mechanism testing method, system, terminal and storage medium

Also Published As

Publication number Publication date
CN113467893B (en) 2024-02-02

Similar Documents

Publication Publication Date Title
US9811369B2 (en) Method and system for physical computer system virtualization
CN102402446B (en) Method and device for installing application software
CN109597626B (en) Component deployment method and device
CN107733985B (en) Method and device for deploying functional components of cloud computing system
CN107608681B (en) Operating system installation method and device and server
CN110096424B (en) Test processing method and device, electronic equipment and storage medium
CN109104337B (en) Method, device and equipment for testing network access control tool
CN110716845A (en) Method for reading log information of Android system
CN104182257A (en) Application software installation method and device
CN107179982B (en) Cross-process debugging method and device
CN112363731A (en) Application automation deployment method and device and computer readable storage medium
CN110968510A (en) SSD automatic online upgrading firmware test method and device and computer equipment
CN107220085B (en) Method for automatically upgrading RAID card firmware
CN102053848A (en) Automatic installation method for Linux operating system
CN113467893B (en) Automatic testing method and device for virtual machine, storage medium and processor
CN111090546A (en) Method, device and equipment for restarting operating system and readable storage medium
CN111880818B (en) Installation method, system and device of virtual machine operating system
CN112564956A (en) Remote upgrading method, equipment and device for client and storage medium
CN111913753A (en) Method and system for changing starting mode in cloud migration of windows system
WO2023087622A1 (en) Virtual machine boot configuration method and apparatus, computer device, and storage medium
CN110806891A (en) Method and device for generating software version of embedded equipment
CN109660575B (en) Method and device for realizing NFV service deployment
CN110968444A (en) Data processing method and device of cloud computing platform
CN111198694A (en) Software installation method and device
US20140282492A1 (en) Information processing apparatus and information processing 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