CN113467893B - Automatic testing method and device for virtual machine, storage medium and processor - Google Patents

Automatic testing method and device for virtual machine, storage medium and processor Download PDF

Info

Publication number
CN113467893B
CN113467893B CN202110797831.6A CN202110797831A CN113467893B CN 113467893 B CN113467893 B CN 113467893B CN 202110797831 A CN202110797831 A CN 202110797831A CN 113467893 B CN113467893 B CN 113467893B
Authority
CN
China
Prior art keywords
virtual machine
software version
upgraded
target virtual
virtualized software
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
CN202110797831.6A
Other languages
Chinese (zh)
Other versions
CN113467893A (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

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

Abstract

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

Description

Automatic testing method and device for virtual machine, storage medium and processor
Technical Field
The application relates to the technical field of software testing, in particular to an automatic testing method and device for a virtual machine, a storage medium and a processor.
Background
With the continuous development of science and technology, the role played by computer virtual machine technology in operation is also becoming more important. In enterprise-derived software versions, virtualized versions have become an integral part.
Testing of a virtualized product often requires extensive installation, upgrades and basic function verification, and test workers often encounter the following problems in doing so: the virtual machine is installed, the software version is updated after the virtual machine is installed, the waiting time is longer, the version needing to be updated and verified is more, the workload is great, the basic function verification work is repeated after each update, a tester usually writes a script to deploy the virtual machine in the virtual product release test work, then IP, destination routing and the like are manually configured on the virtual machine after the virtual machine is deployed, and finally an interface or a web automation test tool is used for testing the basic function.
In the prior art, after virtual deployment is completed, 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 automatically, the IP address of the virtual machine cannot be known after deployment is completed, and subsequent automatic upgrading and basic function verification cannot be performed automatically.
Aiming at the problems of subsequent upgrading of the virtualized version and lower testing efficiency caused by the fact that the system cannot automatically acquire the virtualized version to be upgraded in the related technology, no effective solution is proposed at present.
Disclosure of Invention
The main objective of the present application is to provide a method, an apparatus, a storage medium, and a processor for automatically testing a virtual machine, so as to solve the problem in the related art that the system cannot automatically obtain a virtualized version to be upgraded, resulting in a subsequent upgrade of the virtualized version and a lower testing efficiency.
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 virtualized software version to be upgraded based on a pre-configured IP address in a target virtual machine; triggering an upgrading 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 virtualized 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 comprises: setting the content of the target virtual machine, and acquiring the target virtual machine after setting the content; and deploying the target virtual machine after setting the content.
Further, setting the content of the target virtual machine, and obtaining the target virtual machine after setting the content includes: installing the 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 after setting the 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 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 duration, determining that the target virtual machine deployment process is ended.
Further, after determining that the target virtual machine deployment process is complete, the method further comprises: performing 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 virtualized software version 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; triggering an upgrade request of the virtualized software version to be upgraded based on the target browser interface.
Further, responding 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 an upgrade request operation of a virtualized software version to be upgraded based on system interface information, and setting upgrade waiting time; if the upgrade waiting time is longer than the second preset time length, determining that the upgrade of the virtualized software version is finished, and acquiring the upgraded virtualized software version.
Further, before testing the upgraded virtualized software version, the method further comprises: judging whether the virtualized software version is updated successfully or not; and if the virtualized software version is successfully upgraded, testing the upgraded virtualized software version.
To achieve the above object, according to another aspect of the present application, there is provided an automated virtual machine testing apparatus. The device comprises: the first acquisition unit is used for acquiring a virtualized software version to be upgraded based on a pre-configured IP address in the 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, executing upgrading processing on the virtualized software version to be upgraded and obtaining an upgraded virtualized software version; and the first testing unit is used for testing the upgraded virtualized 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 virtualized software version to be upgraded based on the IP address pre-configured in the target virtual machine, and acquiring the target virtual machine after setting the content; the first deployment unit is used for deploying the target virtual machine after setting the content.
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 acquisition module is used for setting the content of the target virtual machine based on the target file package, and acquiring the target virtual machine after setting the 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 of the deployment target virtual machine; the first setting module is used for setting the deployment waiting time of the target virtual machine; 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 duration.
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 end of the deployment process of the target virtual machine is determined, 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 target route of the target virtual machine; and the third acquisition unit is used for acquiring the virtualized software version to be upgraded based on the pre-configured IP address in the target virtual machine.
Further, the first trigger unit includes: the first calling module is used for calling the target testing tool to log in the target browser interface; the first triggering module is used for triggering an upgrading request of the virtualized 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 virtualized software version to be upgraded based on the target browser interface; the first execution module is used for executing the upgrade request operation of the virtualized software version to be upgraded based on the system interface information and setting upgrade waiting time; and the second determining module is used for determining that the upgrading of the virtualized software version is finished and obtaining the upgraded virtualized software version if the upgrading waiting time is longer than a second preset duration.
Further, the apparatus further comprises: the first judging unit is used for judging whether the updated virtualized software version is successfully updated before testing the updated virtualized software version; and the second testing unit is used for testing the upgraded virtualized software version if the virtualized software version is successfully upgraded.
According to another aspect of the embodiments of the present application, there is further provided a processor, configured to execute a program, where the program executes any one of the above-mentioned automated virtual machine testing methods.
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 method of automated testing of a virtual machine of any of the above.
Through the application, the following steps are adopted: acquiring a virtualized software version to be upgraded based on a pre-configured IP address in a target virtual machine; triggering an upgrading 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 virtualized software version. The method solves the problems of low subsequent upgrading and testing efficiency of the virtualized version due to the fact that the system cannot automatically acquire the virtualized version to be upgraded in the related technology, and further enables the system to automatically perform subsequent automatic upgrading and basic function verification work by acquiring the virtualized software version to be upgraded based on the IP address pre-configured in the target virtual machine, so that the effect of improving the upgrading and testing efficiency of the virtualized version is achieved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application, illustrate and explain the application and are not to be construed as limiting the application. In the drawings:
FIG. 1 is a flow chart of a virtual machine automated testing method provided in accordance with an embodiment of the present application;
FIG. 2 is a system execution flow chart of a virtual machine automated test method provided in accordance with an embodiment of the present application; and
fig. 3 is a schematic diagram of a virtual machine automation testing apparatus provided according to an embodiment of the present application.
Detailed Description
It should be noted that, in the case of no conflict, the embodiments and features in the embodiments may be combined with each other. The present application will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
In order to make the present application solution better understood by those skilled in the art, the following description will be made in detail and with reference to the accompanying drawings in the embodiments of the present application, it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate in order to describe the embodiments of the present application described herein. 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 that are expressly listed or inherent to such process, method, software version, or apparatus.
For convenience of description, the following will describe some terms or terms related to the embodiments of the present application:
ova: open Virtualization Format, open virtualization format, is a virtual machine package.
ovf: open Virtualization Appliance, open virtualization device, is a virtual machine package.
PowerShell: the method is a cross-platform task automation solution and consists of a command line shell, a script language and a configuration management framework.
PowerCLI: as Windows PowerShell plug-in distribution, the method is a powerful command line tool and can automatically execute various aspects of vSphere management.
cmd: command line hints.
bat: the Windows batch processes the suffix name of the script.
ESXi: the virtual host platform has the advantages of high-level resource management function, high efficiency and flexibility.
ps1: powerShell writes script files.
Selenium: a tool for Web application testing.
According to an embodiment of the application, an automated virtual machine testing method is provided.
FIG. 1 is a flow chart of a virtual machine automated testing method according to an embodiment of the present application. As shown in fig. 1, the method comprises the steps of:
step S101, obtaining a virtualized software version to be upgraded based on a pre-configured IP address in a target virtual machine.
Fig. 2 is a flowchart of a system execution of a method for automated testing of a virtual machine according to an embodiment of the present application, where, as shown in fig. 2, a target virtual machine needs to be deployed and configured before a virtualized software version is acquired.
Optionally, in the method for automatically testing a virtual machine provided in the embodiment of the present application, before acquiring a virtualized software version 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 after setting the content; and deploying the target virtual machine after setting the content.
Specifically, before setting content and installing and deploying the target virtual machine, the system needs to build an installation environment of the target virtual machine in advance, in the application, firstly, powerCLI is installed in PowerShell under Windows environment, and a Selenium page automation environment is configured in the same Windows, so that the ESxi server is installed, and then whether a VMware-Tools tool is contained in an ova file is confirmed. If the VMware-Tools are not contained, installing the VMware-Tools in the iso file, then deriving an ova file package with the VMware-Tools, decompressing an ova file folder to obtain a ovf, vmdk, mf file, and setting the content of the target virtual machine after the installation environment of the target virtual machine is built.
Optionally, in the method for automatically testing a virtual machine provided in the embodiment of the present application, performing content setting on a target virtual machine, and obtaining the target virtual machine after setting the content includes: installing the 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 after setting the 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 running a bat script based on a Cmd command, the bat script calls a PowerShell to execute a ps1 script, and then successfully connects to an ESXi server, obtains an ova folder based on an Import-vApp module, decompresses the obtained ovf folder to obtain a ovf folder (corresponding to a target folder in the application), and imports the ovf folder into a building environment of a target virtual machine to set target virtual machine contents, where the target virtual machine contents include a name of the target virtual machine, disk allocation of the target virtual machine, and target storage of the target virtual machine, and after setting the target virtual machine contents, deployment of the target virtual machine is required.
Optionally, in the method for automatically testing a virtual machine provided in the embodiment of the present application, deploying a target virtual machine after setting 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 duration, determining that the target virtual machine deployment process is ended.
For example, the time required for the deployment of the target virtual machine from the beginning to the end is 30min (corresponding to the first preset duration in the application), the system background sets the deployment waiting time of the target virtual machine to be 30min, and if the deployment time of the target virtual machine is detected to exceed 30min, the deployment work of the target virtual machine is proved to be ended, and the deployment efficiency of the application on the target virtual machine is improved through the setting of the first preset duration.
Optionally, in the method for automatically testing a virtual machine provided in the embodiment of the present application, after determining that the target virtual machine deployment process is finished, the method further includes: performing 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 virtualized software version to be upgraded based on the pre-configured IP address in the target virtual machine.
Specifically, the method and the device for automatically upgrading the virtualized software version to be upgraded in the target virtual machine can automatically acquire the subsequent virtualized software version to be upgraded by calling an Invoke-VMScript function (corresponding to a first target script) in the ps1 script, performing configuration operation on an IP address and a target route of the target virtual machine and acquiring the configured target virtual machine, and configuring the IP address and the target route of the target virtual machine in advance based on the script.
Step S102, triggering an upgrade request of the virtualized software version to be upgraded.
Specifically, after the target virtual machine is deployed, the virtualized software version to be upgraded is obtained based on the pre-configured IP address in the target virtual machine, wherein the virtualized software version to be upgraded is obtained by accessing the web interface of the target virtual machine.
Optionally, in the method for automatically testing 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; triggering an upgrade request of the virtualized software version to be upgraded based on the target browser interface.
As shown in fig. 2, after determining the IP address and the destination route of the target virtual machine, calling a Selenium test tool (corresponding to the target test tool in the application) to operate a target browser to open a web interface of the target virtual machine, and triggering an upgrade request of a virtualized software version to be upgraded based on the target browser interface.
Step S103, responding to the upgrade request, and executing upgrade 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, a 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, executing upgrade processing on a virtualized software version to be upgraded, where 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 an upgrade request operation of a virtualized software version to be upgraded based on system interface information, and setting upgrade waiting time; if the upgrade waiting time is longer than the second preset time length, determining that the upgrade of the virtualized software version is finished, and acquiring the upgraded virtualized software version.
For example, based on a web interface of a target virtual machine, logging in to system interface information of a virtualized software version to be upgraded, and executing updating operation on the virtualized software version to be upgraded, if the time required for upgrading the virtualized software version to be upgraded from the beginning to the end is 20min (corresponding to a second preset duration in the application), setting the upgrading waiting time of the virtualized software version to be upgraded to be 20min by a system background, and if the upgrading time of the virtualized software version to be upgraded is detected to exceed 20min, proving that the upgrading work of the virtualized software version to be upgraded is finished, and improving the upgrading efficiency of the virtualized software version of the application through the setting of the second preset duration.
Step S104, testing the updated virtualized software version.
As shown in fig. 2, before testing the upgraded virtualized software version, optionally, in the method for automatically testing a virtual machine provided in the embodiment of the present application, before testing the upgraded virtualized software version, the method further includes: judging whether the virtualized software version is updated successfully or not; and if the virtualized software version is successfully upgraded, testing the upgraded virtualized software version.
Specifically, if the upgrade of the virtualized software version is successful, executing a web automation function test on the upgraded virtualized software version, recording a test result in an operation log, if the upgrade of the virtualized software version fails, terminating the web automation function test on the virtualized software version which is to be upgraded and fails, and recording a verification result in the operation log, so as to facilitate the follow-up query of the log to know the reason of the upgrade failure of the virtualized software version. According to the method and the device, whether the virtualized software version is updated successfully or not is judged, so that the testing efficiency of the updated virtualized software version is improved.
In summary, according to the virtual machine automation test method provided by the embodiment of the application, the virtualized software version to be upgraded is obtained based on the pre-configured IP address in the target virtual machine; triggering an upgrading 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 virtualized software version. The method solves the problems of low subsequent upgrading and testing efficiency of the virtualized version due to the fact that the system cannot automatically acquire the virtualized version to be upgraded in the related technology, and further enables the system to automatically perform subsequent automatic upgrading and basic function verification work by acquiring the virtualized software version to be upgraded based on the IP address pre-configured in the target virtual machine, so that the effect of improving the upgrading and testing efficiency of the virtualized version 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 other than that illustrated herein.
The embodiment of the application also provides a virtual machine automatic testing device, and it is noted that the virtual machine automatic testing device of the embodiment of the application can be used for executing the method for virtual machine automatic testing provided by the embodiment of the application. The following describes an automated virtual machine testing device provided in an embodiment of the present application.
FIG. 3 is a schematic diagram of a virtual machine automated testing apparatus according to an embodiment of the present application. As shown in fig. 3, the apparatus includes: a first acquisition unit 301, a first trigger unit 302, a first execution unit 303, a first test unit 304.
Specifically, the first obtaining unit 301 is configured to obtain a virtualized software version to be upgraded based on an IP address configured in advance in the target virtual machine;
a first triggering unit 302, configured to trigger an upgrade request of a virtualized software version to be upgraded;
the first execution unit 303 is configured to respond to the upgrade request, and execute upgrade processing on the virtualized software version to be upgraded, so as to obtain an upgraded virtualized software version;
the first testing unit 304 is configured to test the upgraded virtualized software version.
In summary, the virtual machine automation testing device provided in the embodiment of the present application is configured to obtain, through the first obtaining unit 301, a virtualized software version to be upgraded based on an IP address configured in advance in a target virtual machine; a first triggering unit 302, configured to trigger an upgrade request of a virtualized software version to be upgraded; the first execution unit 303 is configured to respond to the upgrade request, and execute upgrade processing on the virtualized software version to be upgraded, so as to obtain an upgraded virtualized software version; the first test unit 304 is configured to test the updated virtualized software version, so that the problem that in the related art, due to the fact that the system cannot automatically obtain the virtualized version to be updated, the subsequent virtualized version is updated and the test efficiency is low is solved, and the system can automatically perform subsequent automatic updating and basic function verification work by obtaining the virtualized software version to be updated based on the pre-configured IP address in the target virtual machine, so that the effect of improving the updating and the test efficiency of the virtualized version is achieved.
Optionally, in the virtual machine automation testing 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 virtualized software version to be upgraded based on the IP address pre-configured in the target virtual machine, and acquiring the target virtual machine after setting the content; the first deployment unit is used for deploying the target virtual machine after setting the content.
Optionally, in the virtual machine automation test device provided in the 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 acquisition module is used for setting the content of the target virtual machine based on the target file package, and acquiring the target virtual machine after setting the 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 virtual machine automation test apparatus provided in the embodiment of the present application, the first deployment unit includes: the first starting module is used for starting a power supply of the deployment target virtual machine; the first setting module is used for setting the deployment waiting time of the target virtual machine; 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 duration.
Optionally, in the virtual machine automation testing 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 end of the deployment process of the target virtual machine is determined, 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 target route of the target virtual machine; and the third acquisition unit is used for acquiring the virtualized software version to be upgraded based on the pre-configured IP address in the target virtual machine.
Optionally, in the virtual machine automation testing apparatus provided in the embodiment of the present application, the first triggering unit 302 includes: the first calling module is used for calling the target testing tool to log in the target browser interface; the first triggering module is used for triggering an upgrading request of the virtualized software version to be upgraded based on the target browser interface.
Optionally, in the virtual machine automation test apparatus provided in the embodiment of the present application, the first execution unit 303 includes: the second acquisition module is used for acquiring system interface information of the virtualized software version to be upgraded based on the target browser interface; the first execution module is used for executing the upgrade request operation of the virtualized software version to be upgraded based on the system interface information and setting upgrade waiting time; and the second determining module is used for determining that the upgrading of the virtualized software version is finished and obtaining the upgraded virtualized software version if the upgrading waiting time is longer than a second preset duration.
Optionally, in the virtual machine automation testing apparatus provided in the embodiment of the present application, the apparatus further includes: the first judging unit is used for judging whether the updated virtualized software version is successfully updated before testing the updated virtualized software version; and the second testing unit is used for testing the upgraded virtualized software version if the virtualized software version is successfully upgraded.
The virtual machine automation testing device includes a processor and a memory, where the first acquiring unit 301, the first triggering unit 302, the first executing unit 303, the first testing unit 304, and the like are all stored as program units in the memory, and the processor executes the program units stored in the memory to implement corresponding functions.
The processor includes a kernel, and the kernel fetches the corresponding program unit from the memory. The kernel can be provided with one or more, and the virtual machine automation test is performed by adjusting kernel parameters.
The memory may include volatile memory, random Access Memory (RAM), and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM), among other forms in computer readable media, the memory including at least one memory chip.
The embodiment of the invention provides a storage medium, on which a program is stored, which when executed by a processor, implements a virtual machine automated test method.
The embodiment of the invention provides a processor, which is used for running a program, wherein the program runs to execute a virtual machine automation test method.
The embodiment of the invention provides equipment, which comprises a processor, a memory and a program stored in the memory and capable of running on the processor, wherein the processor realizes the following steps when executing the program: acquiring a virtualized software version to be upgraded based on a pre-configured IP address in a target virtual machine; triggering an upgrading 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 virtualized software version.
The processor also realizes the following steps when executing the program: before acquiring a virtualized software version to be upgraded based on an IP address pre-configured in a target virtual machine, setting content of the target virtual machine, and acquiring the target virtual machine with the content set; and deploying the target virtual machine after setting the content.
The processor also realizes the following steps when executing the program: installing the 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 after setting the 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 also realizes the following steps when executing the program: 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 duration, determining that the target virtual machine deployment process is ended.
The processor also realizes the following steps when executing the program: after the end of the deployment process of the target virtual machine is determined, performing 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 virtualized software version to be upgraded based on the pre-configured IP address in the target virtual machine.
The processor also realizes the following steps when executing the program: calling a target testing tool to log in a target browser interface; triggering an upgrade request of the virtualized software version to be upgraded based on the target browser interface.
The processor also realizes the following steps when executing the program: acquiring system interface information of a virtualized software version to be upgraded based on a target browser interface; executing an upgrade request operation of a virtualized software version to be upgraded based on system interface information, and setting upgrade waiting time; if the upgrade waiting time is longer than the second preset time length, determining that the upgrade of the virtualized software version is finished, and acquiring the upgraded virtualized software version.
The processor also realizes the following steps when executing the program: before testing the updated virtualized software version, judging whether the virtualized software version is successfully updated or not; and if the virtualized software version is successfully upgraded, testing the upgraded virtualized software version.
The device herein may be a server, PC, PAD, cell phone, etc.
The present application also provides a computer program software version adapted to perform, when executed on a data processing device, a program initialized with the method steps of: acquiring a virtualized software version to be upgraded based on a pre-configured IP address in a target virtual machine; triggering an upgrading 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 virtualized software version.
When executed on a data processing device, is further adapted to carry out a program initialized with the method steps of: before acquiring a virtualized software version to be upgraded based on an IP address pre-configured in a target virtual machine, setting content of the target virtual machine, and acquiring the target virtual machine with the content set; and deploying the target virtual machine after setting the content.
When executed on a data processing device, is further adapted to carry out a program initialized with the method steps of: installing the 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 after setting the 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 carry out a program initialized with the method steps of: 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 duration, determining that the target virtual machine deployment process is ended.
When executed on a data processing device, is further adapted to carry out a program initialized with the method steps of: after the end of the deployment process of the target virtual machine is determined, performing 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 virtualized software version 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 carry out a program initialized with the method steps of: calling a target testing tool to log in a target browser interface; 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 carry out a program initialized with the method steps of: acquiring system interface information of a virtualized software version to be upgraded based on a target browser interface; executing an upgrade request operation of a virtualized software version to be upgraded based on system interface information, and setting upgrade waiting time; if the upgrade waiting time is longer than the second preset time length, determining that the upgrade of the virtualized software version is finished, and acquiring the upgraded virtualized software version.
When executed on a data processing device, is further adapted to carry out a program initialized with the method steps of: before testing the updated virtualized software version, judging whether the virtualized software version is successfully updated or not; and if the virtualized software version is successfully upgraded, testing the upgraded virtualized software version.
Those skilled in the art will appreciate that embodiments of the present application may be provided as methods, systems, or computer program software versions. 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 computer program software version 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 flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations 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 one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, etc., such as Read Only Memory (ROM) or flash RAM. 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 storage media for a computer 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, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
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 one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises an element.
Those skilled in the art will appreciate that embodiments of the present application may be provided as methods, systems, or computer program software versions. 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 computer program software version 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 foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and changes may be made to the present application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc. which are within the spirit and principles of the present application are intended to be included within the scope of the claims of the present application.

Claims (10)

1. An automated testing method for a virtual machine, comprising:
acquiring a virtualized software version to be upgraded based on a pre-configured IP address in a target virtual machine;
triggering an upgrading request of the virtualized 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 an upgraded virtualized software version;
testing the updated virtualized software version;
and executing an upgrading request on the virtualized software version to be upgraded, wherein the obtaining the virtualized software version after upgrading comprises the following steps:
acquiring system interface information of the virtualized software version to be upgraded based on a target browser interface;
executing the upgrade request operation of the virtualized software version to be upgraded based on the system interface information, and setting upgrade waiting time;
and if the upgrading waiting time is longer than a second preset time length, determining that the upgrading of the virtualized software version is finished, and acquiring the upgraded virtualized software version.
2. The method of claim 1, wherein prior to retrieving the virtualized software version to be upgraded based on the pre-configured IP address in the target virtual machine, the method further comprises:
setting the content of the target virtual machine, and obtaining the target virtual machine with the set content;
and deploying the target virtual machine after the content is set.
3. The method of claim 2, wherein setting the content for the target virtual machine, and obtaining the target virtual machine after setting the content 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 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.
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 duration, determining that the target virtual machine deployment process is ended.
5. The method of claim 4, wherein after determining that the target virtual machine deployment process is complete, the method further comprises:
performing configuration operation on the target virtual machine based on the first target script, and obtaining a 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 a virtualized software version to be upgraded based on the IP address in the target virtual machine.
6. The method of claim 1, wherein triggering the upgrade request for the virtualized software version to be upgraded comprises:
calling a target testing tool to log in a target browser interface;
triggering the upgrading request of the virtualized software version to be upgraded based on the target browser interface.
7. The method of claim 1, wherein prior to testing the upgraded virtualized software version, the method further comprises:
judging whether the virtualized software version is successfully upgraded or not;
and if the virtualized software version is successfully upgraded, testing the upgraded virtualized software version.
8. An automated virtual machine testing apparatus, comprising:
the first acquisition unit is used for acquiring a virtualized software version to be upgraded based on a pre-configured IP address in the target virtual machine;
the first triggering unit is used for triggering the upgrading request of the virtualized software version to be upgraded;
the first execution unit is used for responding to the upgrading request, executing the upgrading request on the virtualized software version to be upgraded, and obtaining an upgraded virtualized software version;
the first testing unit is used for testing the upgraded virtualized software version;
wherein the first execution unit includes: the second acquisition module is used for acquiring system interface information of the virtualized software version to be upgraded based on the target browser interface; the first execution module is used for executing the upgrade request operation of the virtualized software version to be upgraded based on the system interface information and setting upgrade waiting time; and the second determining module is used for determining that the upgrading of the virtualized software version is finished and obtaining the upgraded virtualized software version if the upgrading waiting time is longer than a second preset duration.
9. A processor for running a program, wherein the program when run performs the method of any one of claims 1 to 7.
10. A storage medium comprising a stored program, wherein the program performs the method of any one of claims 1 to 7.
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 CN113467893A (en) 2021-10-01
CN113467893B true 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)

Families Citing this family (1)

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

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8578376B2 (en) * 2011-01-04 2013-11-05 International Business Machines Corporation Automatically and securely configuring and updating virtual machines

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
云计算环境下业务自动化部署的设计与实现;汪源;刘传昌;;软件(09);全文 *

Also Published As

Publication number Publication date
CN113467893A (en) 2021-10-01

Similar Documents

Publication Publication Date Title
US10942724B2 (en) Release lifecycle management system for multi-node application
US9811369B2 (en) Method and system for physical computer system virtualization
CN102402446B (en) Method and device for installing application software
US9280336B2 (en) Virtual machine disk image installation
CN110955431B (en) Processing method and device of compiling environment
CN107733985B (en) Method and device for deploying functional components of cloud computing system
CN105490860A (en) Method, device and system for deploying application program operation environment
CN110673923A (en) XWIKI system configuration method, system and computer equipment
US20150113532A1 (en) Cloudboot system, virtual machine with the cloudboot system, and method for starting up the virtual machine
CN110716845A (en) Method for reading log information of Android system
CN116049207A (en) Application SQL script processing method and device, processor and electronic equipment
CN113467893B (en) Automatic testing method and device for virtual machine, storage medium and processor
CN107220085B (en) Method for automatically upgrading RAID card firmware
CN115291946A (en) Hongmong system transplanting method, device, electronic equipment and readable medium
JP7410268B2 (en) Methodology for container-based virtualization systems
CN114490103A (en) Operating system interface calling method and device and electronic equipment
CN110837446A (en) Equipment management method and device applied to embedded system, medium and embedded equipment
CN114546819A (en) Code processing method and device, electronic equipment and readable medium
US9317273B2 (en) Information processing apparatus and information processing method
CN107222355B (en) Server upgrading method and device
CN116382713A (en) Method, system, device and storage medium for constructing application mirror image
US20200344305A1 (en) Commissioning a virtualised network function
CN110971642B (en) Data processing method and device for cloud computing platform
CN115113972A (en) Application transformation method, system, cluster, medium and program product
WO2020029995A1 (en) Application upgrading through sharing dependencies

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