CN117520080A - Server testing method, device, equipment and medium - Google Patents

Server testing method, device, equipment and medium Download PDF

Info

Publication number
CN117520080A
CN117520080A CN202311433776.8A CN202311433776A CN117520080A CN 117520080 A CN117520080 A CN 117520080A CN 202311433776 A CN202311433776 A CN 202311433776A CN 117520080 A CN117520080 A CN 117520080A
Authority
CN
China
Prior art keywords
virtual machine
function
operating system
tested
server
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.)
Pending
Application number
CN202311433776.8A
Other languages
Chinese (zh)
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.)
Nettrix Information Industry Beijing Co Ltd
Original Assignee
Nettrix Information Industry Beijing 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 Nettrix Information Industry Beijing Co Ltd filed Critical Nettrix Information Industry Beijing Co Ltd
Priority to CN202311433776.8A priority Critical patent/CN117520080A/en
Publication of CN117520080A publication Critical patent/CN117520080A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/26Functional testing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2205Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
    • G06F11/2236Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested to test CPU or processors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2273Test methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Software Systems (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a server testing method, device, equipment and medium. The method comprises the following steps: determining a target operating system type of a virtual machine corresponding to the tested server according to the application scene of the tested server; installing a preset number of virtual machines in a tested server through a virtual machine deployment script corresponding to the type of the target operating system, and configuring each virtual machine; detecting whether each virtual machine meets a preset test condition; if yes, determining the function to be tested of each virtual machine, and testing the function to be tested of each virtual machine through a test script corresponding to the function to be tested to obtain a function test result; and determining the test result of the tested server. The embodiment of the invention can automatically install and configure a plurality of virtual machines in the server based on the application scene and the virtual machine deployment script, virtualize the server, automatically test the functions of the virtual machines and determine whether the virtualized server can stably operate.

Description

Server testing method, device, equipment and medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a medium for testing a server.
Background
A graphics processor (Graphics Processing Unit, GPU) server may be used to meet different image rendering requirements or data computing requirements. Generally, by virtualizing a GPU server, installing and configuring a plurality of virtual machines in the GPU server, and performing image rendering or data calculation based on each virtual machine in parallel, the utilization efficiency of the GPU server is improved, so that the hardware resources of the GPU server can be effectively utilized. In order to ensure the stability of the GPU server, the GPU server needs to be tested in the development stage of the GPU server, and whether the virtualized GPU server can stably operate is detected.
In the related art, a common server test scheme is generally: the method comprises the steps that a tester manually installs and configures a plurality of virtual machines in a GPU server, virtualizes the GPU server, then detects functions of each virtual machine, and determines whether the virtualized GPU server can stably operate according to function detection results of each virtual machine. The server test scheme in the related art depends on manual operation of testers, and can consume a large amount of labor cost and time cost, so that the test efficiency is low, and the test accuracy cannot be ensured.
Disclosure of Invention
The invention provides a server testing method, device, equipment and medium, which are used for solving the problems that a server testing scheme in the related technology depends on manual operation of testers, a great deal of labor cost and time cost are consumed, the testing efficiency is low, and the testing accuracy cannot be ensured.
According to an aspect of the present invention, there is provided a server testing method, including:
determining a target operating system type corresponding to a tested server according to an application scene of the tested server;
installing a preset number of virtual machines in the tested server through a virtual machine deployment script corresponding to the type of the target operating system, and configuring each virtual machine; wherein the operating system type of each virtual machine is the target operating system type;
detecting whether each virtual machine meets a preset test condition;
if the virtual machines meet the preset test conditions, determining the functions to be tested of the virtual machines according to the target operating system types, and testing the functions to be tested of the virtual machines through test scripts corresponding to the functions to be tested to obtain function test results of the virtual machines;
And determining the test result of the tested server according to the function test result of each virtual machine.
According to the technical scheme, a plurality of virtual machines can be automatically installed and configured in the server based on the application scene of the server and the deployment script of the virtual machine, the server is virtualized, whether each virtual machine in the server can perform functional test can be automatically detected, after each virtual machine is determined to be capable of performing functional test, service functions required to be used by the virtual machine in the running process can be automatically determined according to the operating system type of the virtual machine, the service functions required to be used by the virtual machine in the running process are tested, whether the server after the virtualization can stably run is determined, the testing efficiency and the testing accuracy are improved, and the labor cost and the time cost are reduced.
Optionally, determining, according to an application scenario of the tested server, a target operating system type corresponding to the tested server includes:
acquiring an application scene of a tested server input by a target user through a test management page;
if the application scene is image rendering, determining that the target operating system type corresponding to the tested server is a first operating system type;
And if the application scene is data calculation, determining that the target operating system type corresponding to the tested server is a second operating system type.
According to the technical scheme provided by the embodiment of the invention, the application scene of the tested server can be acquired based on the interaction page, and the type of the operating system of the virtual machine which needs to be installed and configured in the tested server can be determined according to the application scene of the tested server.
Optionally, installing a preset number of virtual machines in the tested server through a virtual machine deployment script corresponding to the target operating system type, and configuring each virtual machine, including:
detecting whether a virtual machine deployment script corresponding to the type of the target operating system exists in a local database;
if yes, virtual machine deployment scripts corresponding to the target operating system type are obtained from the local database, a preset number of virtual machines are installed in the tested server through the virtual machine deployment scripts, and configuration is carried out on each virtual machine.
According to the technical scheme of the embodiment of the invention, after the type of the operating system of the virtual machine which needs to be installed and configured in the tested server is determined according to the application scene of the tested server, the virtual machine deployment script corresponding to the type of the operating system of the virtual machine which needs to be installed and configured in the tested server is obtained from the local database, and a plurality of virtual machines can be automatically installed and configured in the tested server based on the virtual machine deployment script to virtualize the tested server.
Optionally, after detecting whether the virtual machine deployment script corresponding to the target operating system type exists in the local database, the method further includes:
if not, downloading a virtual machine deployment script corresponding to the target operating system type according to the script downloading address of the target operating system type, installing a preset number of virtual machines in the tested server through the virtual machine deployment script, and configuring each virtual machine.
According to the technical scheme of the embodiment of the invention, after the type of the operating system of the virtual machine which needs to be installed and configured in the tested server is determined according to the application scene of the tested server, the virtual machine deployment script corresponding to the type of the operating system of the virtual machine which needs to be installed and configured in the tested server is downloaded, and a plurality of virtual machines can be automatically installed and configured in the tested server based on the virtual machine deployment script to virtualize the tested server.
Optionally, determining a function to be tested of each virtual machine according to the type of the target operating system, and testing the function to be tested of each virtual machine through a test script corresponding to the function to be tested to obtain a function test result of each virtual machine, where the method includes:
If the target operating system type is the first operating system type, determining that the function to be tested of each virtual machine is an image rendering function;
and testing the image rendering function of each virtual machine through a test script corresponding to the image rendering function to obtain an image rendering function test result of each virtual machine.
According to the technical scheme of the embodiment of the invention, the service functions required to be used by the virtual machine in the running process can be determined according to the type of the operating system of the virtual machine in the tested server, and after the service functions required to be used by the virtual machine in the running process are determined to be the image rendering functions, the image rendering functions of the virtual machines are tested based on the test scripts corresponding to the image rendering functions, so that whether the image rendering functions of the virtual machines are normal or not is determined.
Optionally, determining a function to be tested of each virtual machine according to the type of the target operating system, and testing the function to be tested of each virtual machine through a test script corresponding to the function to be tested to obtain a function test result of each virtual machine, where the method includes:
if the target operating system type is the second operating system type, determining that the function to be tested of each virtual machine is a bandwidth function, a communication function and/or a calculation function;
And testing the bandwidth function, the communication function and/or the calculation function of each virtual machine through test scripts corresponding to the bandwidth function, the communication function and/or the calculation function to obtain a bandwidth function test result, a communication function test result and/or a calculation function test result of each virtual machine.
According to the technical scheme of the embodiment of the invention, the service functions which are needed to be used by the virtual machine in the running process can be determined according to the type of the operating system of the virtual machine in the tested server, and whether the bandwidth functions, the communication functions and the calculation functions of the virtual machines are normal or not can be determined after the service functions which are needed to be used by the virtual machine in the running process are determined to be the bandwidth functions, the communication functions and the calculation functions based on test scripts corresponding to the bandwidth functions, the communication functions and the calculation functions.
Optionally, detecting whether each virtual machine meets a preset test condition includes:
and detecting whether each virtual machine meets a preset test condition according to the type of the operating system of each virtual machine.
According to the technical scheme provided by the embodiment of the invention, after a plurality of virtual machines are automatically installed and configured in the tested server based on the virtual machine deployment script, whether each virtual machine can perform functional test or not can be detected according to the type of the operating system of each virtual machine.
According to another aspect of the present invention, there is provided a server testing apparatus including:
the type determining module is used for determining the type of a target operating system corresponding to the tested server according to the application scene of the tested server;
the virtual machine deployment module is used for installing a preset number of virtual machines in the tested server through a virtual machine deployment script corresponding to the type of the target operating system, and configuring each virtual machine; wherein the operating system type of each virtual machine is the target operating system type;
the condition detection module is used for detecting whether each virtual machine meets a preset test condition;
the function test module is used for determining the function to be tested of each virtual machine according to the type of the target operating system if each virtual machine meets the preset test condition, and testing the function to be tested of each virtual machine through a test script corresponding to the function to be tested to obtain a function test result of each virtual machine;
and the result determining module is used for determining the test result of the tested server according to the function test result of each virtual machine.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor;
and a memory communicatively coupled to the at least one processor network;
wherein the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the server testing method of any one of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer readable storage medium storing computer instructions for causing a processor to execute a server testing method according to any one of the embodiments of the present invention.
According to the technical scheme, the type of the target operating system corresponding to the tested server is determined according to the application scene of the tested server; then installing a preset number of virtual machines in a tested server through a virtual machine deployment script corresponding to the type of the target operating system, and configuring each virtual machine; detecting whether each virtual machine meets a preset test condition; if each virtual machine meets the preset test conditions, determining the function to be tested of each virtual machine according to the type of the target operating system, and testing the function to be tested of each virtual machine through a test script corresponding to the function to be tested to obtain a function test result of each virtual machine; and finally, determining the test result of the tested server according to the function test result of each virtual machine, solving the problems that a server test scheme in the related technology depends on manual operation of testers, consumes a great amount of labor cost and time cost, has lower test efficiency and cannot guarantee test accuracy.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of a server testing method according to an embodiment of the present invention.
Fig. 2 is a flowchart of a server testing method according to a second embodiment of the present invention.
Fig. 3 is a flowchart of a server testing method according to a third embodiment of the present invention.
Fig. 4 is a schematic structural diagram of a server testing device according to a fourth embodiment of the present invention.
Fig. 5 is a schematic structural diagram of an electronic device implementing a server testing method according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "object," "first," "second," and the like in the description and the claims of the present invention and the above drawings 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 such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise 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, article, 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, article, or apparatus.
Example 1
Fig. 1 is a flowchart of a server testing method according to an embodiment of the present invention. The method and the device can be applied to testing the GPU server and detecting whether the virtualized GPU server can stably run or not. The method may be performed by a server test device, which may be implemented in hardware and/or software, which may be configured in a server under test. As shown in fig. 1, the method includes:
step 101, determining a target operating system type corresponding to a tested server according to an application scene of the tested server.
Alternatively, the server under test is the GPU server that needs to be tested. The application scenario of the server under test is information for characterizing the scenario in which the server under test is used. The application scene of the tested server is image rendering or data calculation. The application scene of the tested server is image rendering, which indicates that the scene where the tested server is used is image rendering, and the tested server is a GPU server for image rendering. The application scene of the tested server is data calculation, which indicates that the scene where the tested server is used is data calculation, and the tested server is a GPU server for data calculation. The target operating system type corresponding to the tested server is the operating system type of the virtual machine to be installed and configured in the tested server.
Optionally, determining, according to an application scenario of the tested server, a target operating system type corresponding to the tested server includes: acquiring an application scene of a tested server input by a target user through a test management page; if the application scene is image rendering, determining that the target operating system type corresponding to the tested server is a first operating system type; and if the application scene is data calculation, determining that the target operating system type corresponding to the tested server is a second operating system type.
Therefore, the application scene of the tested server can be obtained based on the interaction page, and the type of the operating system of the virtual machine which needs to be installed and configured in the tested server can be determined according to the application scene of the tested server.
Optionally, the test management page is a page for interacting with the target user, acquiring various information related to the tested server input by the target user, and displaying various information related to the test process of the tested server to the target user. The target user may be a tester responsible for managing the testing process of the server under test. The target user can input the application scene of the tested server by filling or selecting the application scene of the tested server in the test management page.
Alternatively, in general, the types of operating systems of virtual machines that need to be installed and configured in servers of different application scenarios are also different. The first operating system type and the second operating system type are two different operating system types. A virtual machine of a first operating system type needs to be installed and configured in a GPU server for image rendering. The virtual machine of which the operating system type is the first operating system type is suitable for image rendering. The first operating system type may be a Windows operating system. The GPU server for performing data computation needs to install and configure a virtual machine whose operating system type is the second operating system type. The virtual machine of which the operating system type is the second operating system type is adapted to perform data calculations. The second operating system type may be the Ubuntu operating system. Therefore, the application scene of the tested server input by the target user is acquired. If the application scene is image rendering, which indicates that the tested server is a GPU server for performing image rendering, and a virtual machine with an operating system type of a first operating system type needs to be installed and configured, it may be determined that the target operating system type corresponding to the tested server is the first operating system type. If the application scenario is data calculation, which indicates that the tested server is a GPU server for performing data calculation, and a virtual machine with an operating system type of a second operating system type needs to be installed and configured, it may be determined that the target operating system type corresponding to the tested server is the second operating system type.
Step 102, installing a preset number of virtual machines in the tested server through a virtual machine deployment script corresponding to the target operating system type, and configuring each virtual machine.
Wherein the operating system type of each virtual machine is the target operating system type.
Optionally, the virtual machine deployment script corresponding to the target operating system type is a script that can be used to install a preset number of virtual machines whose operating system types are the target operating system type in the server after running, and configure each virtual machine. When the virtual machine deployment script corresponding to the target operating system type is executed, the operation of installing a preset number of virtual machines of which the operating system type is the target operating system type in the server and configuring each virtual machine is executed. The preset number is more than or equal to 2. The preset number may be set according to the service requirement. Configuring the virtual machine may refer to configuring parameter values of respective parameters in the virtual machine to desired parameter values corresponding to the respective parameters. The desired parameter value corresponding to the parameter may be a parameter value specified by the target user for the parameter.
Optionally, installing a preset number of virtual machines in the tested server through a virtual machine deployment script corresponding to the target operating system type, and configuring each virtual machine, including: detecting whether a virtual machine deployment script corresponding to the type of the target operating system exists in a local database; if yes, virtual machine deployment scripts corresponding to the target operating system type are obtained from the local database, a preset number of virtual machines are installed in the tested server through the virtual machine deployment scripts, and configuration is carried out on each virtual machine.
Therefore, after the type of the operating system of the virtual machine to be installed and configured in the tested server is determined according to the application scene of the tested server, the virtual machine deployment script corresponding to the type of the operating system of the virtual machine to be installed and configured in the tested server can be obtained from the local database, and a plurality of virtual machines can be automatically installed and configured in the tested server based on the virtual machine deployment script to virtualize the tested server.
Optionally, after detecting whether the virtual machine deployment script corresponding to the target operating system type exists in the local database, the method further includes: if not, downloading a virtual machine deployment script corresponding to the target operating system type according to the script downloading address of the target operating system type, installing a preset number of virtual machines in the tested server through the virtual machine deployment script, and configuring each virtual machine.
Therefore, after the type of the operating system of the virtual machine to be installed and configured in the tested server is determined according to the application scene of the tested server, the virtual machine deployment script corresponding to the type of the operating system of the virtual machine to be installed and configured in the tested server is downloaded, and a plurality of virtual machines can be automatically installed and configured in the tested server based on the virtual machine deployment script to virtualize the tested server.
Optionally, the electronic device may detect whether a virtual machine deployment script corresponding to the target operating system type exists in the local database according to a name of the virtual machine deployment script corresponding to the target operating system type. And detecting whether a script with the same name as the virtual machine deployment script corresponding to the type of the target operating system is stored in the local database. If yes, determining that a virtual machine deployment script corresponding to the type of the target operating system exists in the local database; if not, determining that the virtual machine deployment script corresponding to the type of the target operating system does not exist in the local database. The script with the same name as the virtual machine deployment script corresponding to the target operating system type is the virtual machine deployment script corresponding to the target operating system type.
Optionally, if the virtual machine deployment script corresponding to the target operating system type exists in the local database, the virtual machine deployment script corresponding to the target operating system type is directly obtained from the local database. And then running a virtual machine deployment script corresponding to the target operating system type, so that a preset number of virtual machines with the operating system type being the target operating system type are installed in the tested server through the virtual machine deployment script, and each virtual machine is configured.
Optionally, the script download address of the target operating system type is an address for downloading a virtual machine deployment script corresponding to the target operating system type. The electronic device stores therein a script download address of the target operating system type. And if the virtual machine deployment script corresponding to the target operating system type does not exist in the local database, downloading the virtual machine deployment script corresponding to the target operating system type according to the script downloading address of the target operating system type. And then running a virtual machine deployment script corresponding to the target operating system type, so that a preset number of virtual machines with the operating system type being the target operating system type are installed in the tested server through the virtual machine deployment script, and each virtual machine is configured.
Optionally, in the case that the target operating system type is the first operating system type, installing a preset number of virtual machines in the tested server through a virtual machine deployment script corresponding to the target operating system type, and configuring each virtual machine, including: detecting whether a virtual machine deployment script corresponding to a first operating system type exists in a local database; if yes, virtual machine deployment scripts corresponding to a first operating system type are obtained from the local database, a preset number of virtual machines are installed in the tested server through the virtual machine deployment scripts, and configuration is carried out on each virtual machine; if not, downloading a virtual machine deployment script corresponding to the first operating system type according to the script downloading address of the first operating system type, installing a preset number of virtual machines in the tested server through the virtual machine deployment script, and configuring each virtual machine.
Optionally, the virtual machine deployment script corresponding to the first operating system type is a script that can be used to install a preset number of virtual machines with operating system types being the first operating system type in the server after running, and configure each virtual machine. When the virtual machine deployment script corresponding to the first operating system type is executed, the operation of installing a preset number of virtual machines with the operating system type being the first operating system type in the server and configuring each virtual machine is executed.
Optionally, the electronic device detects whether a script with a name identical to a name of the virtual machine deployment script corresponding to the first operating system type is stored in the local database. If yes, determining that a virtual machine deployment script corresponding to the first operating system type exists in the local database; if not, determining that the virtual machine deployment script corresponding to the first operating system type does not exist in the local database. The script with the same name as the virtual machine deployment script corresponding to the first operating system type is the virtual machine deployment script corresponding to the first operating system type.
Optionally, if the virtual machine deployment script corresponding to the first operating system type exists in the local database, the virtual machine deployment script corresponding to the first operating system type is directly obtained from the local database. And then running a virtual machine deployment script corresponding to the first operating system type, so that a preset number of virtual machines with the operating system type being the first operating system type are installed in the tested server through the virtual machine deployment script, and each virtual machine is configured.
Optionally, the script download address of the first operating system type is an address for downloading a virtual machine deployment script corresponding to the first operating system type. The electronic device stores therein a script download address of a first operating system type. If the virtual machine deployment script corresponding to the first operating system type does not exist in the local database, downloading the virtual machine deployment script corresponding to the first operating system type according to the script downloading address of the first operating system type. And then running a virtual machine deployment script corresponding to the first operating system type, so that a preset number of virtual machines with the operating system type being the first operating system type are installed in the tested server through the virtual machine deployment script, and each virtual machine is configured.
Optionally, in the case that the target operating system type is the second operating system type, installing a preset number of virtual machines in the tested server through a virtual machine deployment script corresponding to the target operating system type, and configuring each virtual machine, including: detecting whether a virtual machine deployment script corresponding to a second operating system type exists in a local database; if yes, virtual machine deployment scripts corresponding to a second operating system type are obtained from the local database, a preset number of virtual machines are installed in the tested server through the virtual machine deployment scripts, and configuration is carried out on each virtual machine; if not, downloading a virtual machine deployment script corresponding to the second operating system type according to the script downloading address of the second operating system type, installing a preset number of virtual machines in the tested server through the virtual machine deployment script, and configuring each virtual machine.
Optionally, the virtual machine deployment script corresponding to the second operating system type is a script that can be used to install a preset number of virtual machines with the operating system type being the second operating system type in the server after running, and configure each virtual machine. When the virtual machine deployment script corresponding to the second operating system type is executed, the operation of installing a preset number of virtual machines with the operating system type being the second operating system type in the server and configuring each virtual machine is executed.
Optionally, the electronic device detects whether a script with the same name as the virtual machine deployment script corresponding to the second operating system type is stored in the local database. If yes, determining that a virtual machine deployment script corresponding to the second operating system type exists in the local database; if not, determining that the virtual machine deployment script corresponding to the second operating system type does not exist in the local database. The script with the same name as the virtual machine deployment script corresponding to the second operating system type is the virtual machine deployment script corresponding to the second operating system type.
Optionally, if the virtual machine deployment script corresponding to the second operating system type exists in the local database, the virtual machine deployment script corresponding to the second operating system type is directly obtained from the local database. And then running a virtual machine deployment script corresponding to the second operating system type, so that a preset number of virtual machines with the operating system type being the second operating system type are installed in the tested server through the virtual machine deployment script, and each virtual machine is configured.
Optionally, the script download address of the second operating system type is an address for downloading a virtual machine deployment script corresponding to the second operating system type. The electronic device stores a script download address of the second operating system type. And if the virtual machine deployment script corresponding to the second operating system type does not exist in the local database, downloading the virtual machine deployment script corresponding to the second operating system type according to the script downloading address of the second operating system type. And then running a virtual machine deployment script corresponding to the second operating system type, so that a preset number of virtual machines with the operating system type being the second operating system type are installed in the tested server through the virtual machine deployment script, and each virtual machine is configured.
Step 103, detecting whether each virtual machine meets a preset test condition.
Optionally, the preset test condition is a condition for judging whether the virtual machine can perform the functional test. The preset test condition may be that the operating system type of the virtual machine is a target operating system type. Typically, if the operating system type of the virtual machine is the target operating system type, it indicates that the virtual machine is successfully installed and successfully configured, and a functional test may be performed. If the operating system type of the virtual machine is not the target operating system type, the virtual machine is indicated to be failed to be installed or configured, and the function test cannot be performed. If the virtual machine meets the preset test condition, namely the operating system type of the virtual machine is the target operating system type, the virtual machine can be determined to be capable of performing functional test. If the virtual machine does not meet the preset test condition, i.e. the operating system type of the virtual machine is not the target operating system type, the virtual machine can be determined to be incapable of performing functional test.
Optionally, detecting whether each virtual machine meets a preset test condition includes: and detecting whether each virtual machine meets a preset test condition according to the type of the operating system of each virtual machine.
Therefore, after a plurality of virtual machines are automatically installed and configured in the tested server based on the virtual machine deployment script, whether each virtual machine can perform functional test or not can be detected according to the operating system type of each virtual machine.
Optionally, detecting, according to the type of the operating system of each virtual machine, whether each virtual machine meets a preset test condition includes: the following operations are performed for each virtual machine: detecting whether the operating system type of the virtual machine is a target operating system type; if yes, determining that the virtual machine meets the preset test condition; if not, determining that the virtual machine does not meet the preset test condition.
Optionally, if any virtual machine does not meet the preset test condition, the abnormal prompt information is sent to the terminal equipment of the target user. The abnormal prompt information is information for prompting that the virtual machine exists in the tested server and cannot perform functional test. The terminal device of the target user is a terminal device used by the target user.
104, if each virtual machine meets the preset test condition, determining a function to be tested of each virtual machine according to the type of the target operating system, and testing the function to be tested of each virtual machine through a test script corresponding to the function to be tested to obtain a function test result of each virtual machine.
Optionally, if each virtual machine meets the preset test condition, which indicates that all virtual machines are successfully installed and successfully configured, and a function test can be performed, the functions of all virtual machines are continuously detected, and whether the functions of the server to be tested after virtualization are stable is determined according to the function detection results of all virtual machines.
Optionally, the function to be tested of the virtual machine is a service function that the virtual machine needs to use in the running process. The test script corresponding to the function to be tested is a script for testing whether the function to be tested of the virtual machine is normal.
Optionally, the functions to be tested of the virtual machines in the servers of different application scenarios are also different. The function to be tested of the virtual machine in the GPU server, which applies scene to image rendering, is the image rendering function. The image rendering function may be a function of performing image rendering. The functions to be tested of the virtual machine in the GPU server, the application scene of which is data calculation, are bandwidth functions, communication functions and/or calculation functions. The bandwidth function may be a function of adjusting a communication bandwidth. The communication function may be a function of communicating with other components or devices. The calculation function may be a function of performing matrix calculation and general calculation.
Optionally, determining a function to be tested of each virtual machine according to the type of the target operating system, and testing the function to be tested of each virtual machine through a test script corresponding to the function to be tested to obtain a function test result of each virtual machine, where the method includes: if the target operating system type is the first operating system type, determining that the function to be tested of each virtual machine is an image rendering function; and testing the image rendering function of each virtual machine through a test script corresponding to the image rendering function to obtain an image rendering function test result of each virtual machine.
Therefore, the service functions required to be used by the virtual machines in the running process can be determined according to the types of the operating systems of the virtual machines in the tested server, and after the service functions required to be used by the virtual machines in the running process are determined to be the image rendering functions, the image rendering functions of the virtual machines are tested based on test scripts corresponding to the image rendering functions, so that whether the image rendering functions of the virtual machines are normal or not is determined.
Optionally, if the target operating system type is the first operating system type, which indicates that the server to be tested is a GPU server for rendering an image with an application scene, it may be determined that the function to be tested of each virtual machine is an image rendering function.
Optionally, the image rendering function of each virtual machine is tested by a test script corresponding to the image rendering function, to obtain a test result of the image rendering function of each virtual machine, including: the following operations are performed for each virtual machine: acquiring a test script corresponding to an image rendering function from a local database; running a test script corresponding to the image rendering function in the virtual machine; if the test script corresponding to the image rendering function runs successfully, determining that the image rendering function test result of the virtual machine is normal; if the test script corresponding to the image rendering function fails to run, determining that the image rendering function test result of the virtual machine is abnormal.
Optionally, the test script corresponding to the image rendering function is a script that is used to detect whether the image rendering function of the virtual machine is normal after running. Typically, a test script corresponding to the image rendering function is run in the virtual machine. And if the test script corresponding to the image rendering function runs successfully, indicating that the image rendering function of the virtual machine is normal. If the test script corresponding to the image rendering function fails to run, the image rendering function of the virtual machine is abnormal. A test script corresponding to the image rendering function is stored in a local database of the electronic device. The electronic device may obtain a test script corresponding to the image rendering function from the local database, and run the test script corresponding to the image rendering function in the virtual machine.
Optionally, the image rendering function test result of the virtual machine is information for characterizing whether the image rendering function of the virtual machine is normal. The image rendering function test result of the virtual machine is normal or abnormal. The image rendering function test result of the virtual machine is normal, which indicates that the image rendering function of the virtual machine is normal. The image rendering function test result of the virtual machine is abnormal, which indicates that the image rendering function of the virtual machine is abnormal. Accordingly, a test script corresponding to the image rendering function is run in the virtual machine. If the test script corresponding to the image rendering function runs successfully, that is, the image rendering function of the virtual machine is normal, it can be determined that the test result of the image rendering function of the virtual machine is normal. If the test script corresponding to the image rendering function fails to run, namely the image rendering function of the virtual machine is abnormal, the image rendering function test result of the virtual machine can be determined to be abnormal.
Optionally, determining a function to be tested of each virtual machine according to the type of the target operating system, and testing the function to be tested of each virtual machine through a test script corresponding to the function to be tested to obtain a function test result of each virtual machine, where the method includes: if the target operating system type is the second operating system type, determining that the function to be tested of each virtual machine is a bandwidth function, a communication function and/or a calculation function; and testing the bandwidth function, the communication function and/or the calculation function of each virtual machine through test scripts corresponding to the bandwidth function, the communication function and/or the calculation function to obtain a bandwidth function test result, a communication function test result and/or a calculation function test result of each virtual machine.
Therefore, the service functions which are needed to be used by the virtual machine in the running process can be determined according to the type of the operating system of the virtual machine in the tested server, and after the service functions which are needed to be used by the virtual machine in the running process are determined to be the bandwidth functions, the communication functions and the calculation functions, the bandwidth functions, the communication functions and the calculation functions of each virtual machine are tested based on test scripts corresponding to the bandwidth functions, the communication functions and the calculation functions, so that whether the bandwidth functions, the communication functions and the calculation functions of each virtual machine are normal or not is determined.
Optionally, if the target operating system type is the second operating system type, which indicates that the tested server is a GPU server for computing data in an application scenario, it may be determined that the function to be tested of each virtual machine is a bandwidth function, a communication function, and/or a computing function.
Optionally, testing the bandwidth function of each virtual machine through a test script corresponding to the bandwidth function to obtain a bandwidth function test result of each virtual machine, including: the following operations are performed for each virtual machine: obtaining a test script corresponding to the bandwidth function from a local database; running a test script corresponding to the bandwidth function in the virtual machine; if the test script corresponding to the bandwidth function is successfully operated, determining that the bandwidth function test result of the virtual machine is normal; if the test script corresponding to the bandwidth function fails to run, determining that the bandwidth function test result of the virtual machine is abnormal.
Optionally, the test script corresponding to the bandwidth function is a script that is used to detect whether the bandwidth function of the virtual machine is normal after running. Typically, a test script corresponding to the bandwidth function is run in the virtual machine. And if the test script corresponding to the bandwidth function is successfully operated, indicating that the bandwidth function of the virtual machine is normal. And if the test script corresponding to the bandwidth function fails to run, indicating that the bandwidth function of the virtual machine is abnormal. The local database of the electronic equipment stores test scripts corresponding to the bandwidth functions. The electronic device may obtain a test script corresponding to the bandwidth function from the local database, and run the test script corresponding to the bandwidth function in the virtual machine.
Optionally, the bandwidth function test result of the virtual machine is information for characterizing whether the bandwidth function of the virtual machine is normal. The bandwidth function test result of the virtual machine is normal or abnormal. The bandwidth function test result of the virtual machine is normal, which indicates that the bandwidth function of the virtual machine is normal. The bandwidth function test result of the virtual machine is abnormal, which indicates that the bandwidth function of the virtual machine is abnormal. Accordingly, a test script corresponding to the bandwidth function is run in the virtual machine. If the test script corresponding to the bandwidth function is successful in running, namely the bandwidth function of the virtual machine is normal, the test result of the bandwidth function of the virtual machine can be determined to be normal; if the test script corresponding to the bandwidth function fails to run, namely the bandwidth function of the virtual machine is abnormal, the bandwidth function test result of the virtual machine can be determined to be abnormal.
Optionally, the testing the communication function of each virtual machine through a test script corresponding to the communication function to obtain a communication function test result of each virtual machine, including: the following operations are performed for each virtual machine: acquiring a test script corresponding to a communication function from a local database; running a test script corresponding to the communication function in the virtual machine; if the test script corresponding to the communication function runs successfully, determining that the communication function test result of the virtual machine is normal; if the test script corresponding to the communication function fails to run, determining that the communication function test result of the virtual machine is abnormal.
Optionally, the test script corresponding to the communication function is a script that is used to detect whether the communication function of the virtual machine is normal after running. Typically, a test script corresponding to a communication function is run in a virtual machine. And if the test script corresponding to the communication function runs successfully, indicating that the communication function of the virtual machine is normal. If the test script corresponding to the communication function fails to run, the communication function of the virtual machine is abnormal. The local database of the electronic equipment stores test scripts corresponding to the communication functions. The electronic device may obtain a test script corresponding to the communication function from the local database, and run the test script corresponding to the communication function in the virtual machine.
Optionally, the communication function test result of the virtual machine is information for characterizing whether the communication function of the virtual machine is normal. The communication function test result of the virtual machine is normal or abnormal. The communication function test result of the virtual machine is normal, which indicates that the communication function of the virtual machine is normal. The communication function test result of the virtual machine is abnormal, which indicates that the communication function of the virtual machine is abnormal. Accordingly, a test script corresponding to the communication function is run in the virtual machine. If the test script corresponding to the communication function runs successfully, namely the communication function of the virtual machine is normal, the communication function test result of the virtual machine can be determined to be normal; if the test script corresponding to the communication function fails to run, namely the communication function of the virtual machine is abnormal, the communication function test result of the virtual machine can be determined to be abnormal.
Optionally, testing the computing function of each virtual machine through a test script corresponding to the computing function to obtain a computing function test result of each virtual machine, including: the following operations are performed for each virtual machine: acquiring a test script corresponding to a calculation function from a local database; running a test script corresponding to the computing function in the virtual machine; if the test script corresponding to the calculation function runs successfully, determining that the calculation function test result of the virtual machine is normal; if the test script corresponding to the computing function fails to run, determining that the computing function test result of the virtual machine is abnormal.
Optionally, the test script corresponding to the computing function is a script that is used to detect whether the computing function of the virtual machine is normal after running. Typically, test scripts corresponding to the computing functions are run in the virtual machine. And if the test script corresponding to the calculation function runs successfully, indicating that the calculation function of the virtual machine is normal. If the test script corresponding to the calculation function fails to run, the calculation function of the virtual machine is abnormal. The local database of the electronic equipment stores test scripts corresponding to the computing functions. The electronic device may obtain a test script corresponding to the computing function from the local database, and run the test script corresponding to the computing function in the virtual machine.
Optionally, the calculation function test result of the virtual machine is information for characterizing whether the calculation function of the virtual machine is normal. The result of the calculation function test of the virtual machine is normal or abnormal. The calculation function test result of the virtual machine is normal, which indicates that the calculation function of the virtual machine is normal. The result of the calculation function test of the virtual machine is abnormal, which indicates that the calculation function of the virtual machine is abnormal. Thus, a test script corresponding to the computing function is run in the virtual machine. If the test script corresponding to the calculation function runs successfully, namely the calculation function of the virtual machine is normal, the calculation function test result of the virtual machine can be determined to be normal; if the test script corresponding to the computing function fails to run, namely the computing function of the virtual machine is abnormal, the computing function test result of the virtual machine can be determined to be abnormal.
Optionally, testing the bandwidth function, the communication function and the calculation function of each virtual machine through test scripts corresponding to the bandwidth function, the communication function and the calculation function to obtain a bandwidth function test result, a communication function test result and a calculation function test result of each virtual machine, including: the following operations are performed for each virtual machine: obtaining a test script corresponding to the bandwidth function from a local database; running a test script corresponding to the bandwidth function in the virtual machine; if the test script corresponding to the bandwidth function is successfully operated, determining that the bandwidth function test result of the virtual machine is normal; if the test script corresponding to the bandwidth function fails to run, determining that the bandwidth function test result of the virtual machine is abnormal; acquiring a test script corresponding to a communication function from a local database; running a test script corresponding to the communication function in the virtual machine; if the test script corresponding to the communication function runs successfully, determining that the communication function test result of the virtual machine is normal; if the test script corresponding to the communication function fails to run, determining that the communication function test result of the virtual machine is abnormal; acquiring a test script corresponding to a calculation function from a local database; running a test script corresponding to the computing function in the virtual machine; if the test script corresponding to the calculation function runs successfully, determining that the calculation function test result of the virtual machine is normal; if the test script corresponding to the computing function fails to run, determining that the computing function test result of the virtual machine is abnormal.
Step 105, determining the test result of the tested server according to the function test result of each virtual machine.
Optionally, determining the test result of the tested server according to the function test result of each virtual machine includes: detecting whether the function test result of each virtual machine is normal; if the function test result of each virtual machine is normal, determining that the test result of the tested server is qualified; if any one of the function test results of the virtual machines is abnormal, determining that the test result of the tested server is unqualified.
Optionally, if the function test result of each virtual machine is normal, it indicates that the function of each virtual machine in the tested server is normal after the tested server is virtualized, and the tested server can stably run. If any one of the function test results of the virtual machines is abnormal, the virtual machines with abnormal functions in the tested server cannot be stably operated after the tested server is virtualized.
Optionally, the test result of the tested server is information for characterizing whether the tested server can stably run after being virtualized. And the test result of the tested server is qualified, which indicates that the tested server after virtualization can stably run. And the test result of the tested server is unqualified, which indicates that the tested server after virtualization cannot stably run. Therefore, if the function test results of the virtual machines are normal, which indicates that the functions of the virtual machines in the tested server are normal after the tested server is virtualized, the tested server can stably run, and the test results of the tested server can be determined to be qualified. If any one of the function test results of the virtual machines is abnormal, which indicates that the virtual machines with abnormal functions exist in the tested server after the tested server is virtualized, the tested server can not stably run, and the test result of the tested server can be determined to be unqualified.
Optionally, if the application scene of the tested server is image rendering, the function test result of each virtual machine is the image rendering function test result of each virtual machine. And detecting whether the image rendering function test result of each virtual machine is normal. If the image rendering function test results of the virtual machines are normal, indicating that the image rendering functions of the virtual machines in the tested server are normal after the tested server is virtualized, and the tested server can stably run, the test results of the tested server can be determined to be qualified. If any one of the image rendering function test results of the virtual machines is abnormal, which indicates that the virtual machines with abnormal image rendering functions exist in the tested server after the tested server is virtualized, the tested server cannot stably operate, and the test result of the tested server can be determined to be unqualified.
Optionally, if the application scenario of the tested server is data calculation, the function test result of each virtual machine is a bandwidth function test result, a communication function test result and/or a calculation function test result of each virtual machine. And detecting whether the function test result of each virtual machine is normal. If the function test result of each virtual machine is normal, which indicates that the function of each virtual machine in the tested server is normal after the tested server is virtualized, the tested server can stably run, and the test result of the tested server can be determined to be qualified. If any one of the function test results of the virtual machines is abnormal, which indicates that the virtual machines with abnormal functions exist in the tested server after the tested server is virtualized, the tested server can not stably run, and the test result of the tested server can be determined to be unqualified.
According to the technical scheme, the type of the target operating system corresponding to the tested server is determined according to the application scene of the tested server; then installing a preset number of virtual machines in a tested server through a virtual machine deployment script corresponding to the type of the target operating system, and configuring each virtual machine; detecting whether each virtual machine meets a preset test condition; if each virtual machine meets the preset test conditions, determining the function to be tested of each virtual machine according to the type of the target operating system, and testing the function to be tested of each virtual machine through a test script corresponding to the function to be tested to obtain a function test result of each virtual machine; and finally, determining the test result of the tested server according to the function test result of each virtual machine, solving the problems that a server test scheme in the related technology depends on manual operation of testers, consumes a great amount of labor cost and time cost, has lower test efficiency and cannot guarantee test accuracy.
Example two
Fig. 2 is a flowchart of a server testing method according to a second embodiment of the present invention. Embodiments of the invention may be combined with various alternatives to one or more of the embodiments described above. As shown in fig. 2, the method includes:
step 201, determining a target operating system type corresponding to a tested server according to an application scene of the tested server.
Step 202, detecting whether a virtual machine deployment script corresponding to the target operating system type exists in a local database: if yes, go to step 203; if not, go to step 204.
Step 203, a virtual machine deployment script corresponding to the target operating system type is obtained from the local database, a preset number of virtual machines are installed in the tested server through the virtual machine deployment script, and each virtual machine is configured. After the execution of step 203 is completed, step 205 is executed.
Step 204, downloading a virtual machine deployment script corresponding to the target operating system type according to the script download address of the target operating system type, installing a preset number of virtual machines in the tested server through the virtual machine deployment script, and configuring each virtual machine.
Wherein the operating system type of each virtual machine is the target operating system type.
Step 205, detecting whether each virtual machine meets a preset test condition.
Step 206, if each virtual machine meets the preset test condition, determining a function to be tested of each virtual machine according to the type of the target operating system, and testing the function to be tested of each virtual machine through a test script corresponding to the function to be tested to obtain a function test result of each virtual machine.
Step 207, determining a test result of the tested server according to the function test result of each virtual machine.
According to the technical scheme, under the condition that the virtual machine deployment script corresponding to the operating system type of the virtual machine needing to be installed and configured in the tested server is stored in the local database, the virtual machine deployment script corresponding to the operating system type of the virtual machine needing to be installed and configured in the tested server can be directly obtained from the local database, under the condition that the virtual machine deployment script corresponding to the operating system type of the virtual machine needing to be installed and configured in the tested server is not stored in the local database, the virtual machine deployment script corresponding to the operating system type of the virtual machine needing to be installed and configured in the tested server can be automatically downloaded, and a plurality of virtual machines can be automatically installed and configured in the tested server based on the virtual machine deployment script, so that the tested server is virtualized.
Example III
Fig. 3 is a flowchart of a server testing method according to a third embodiment of the present invention, including the following steps:
step 301, determining a target operating system type of a virtual machine corresponding to a tested server according to an application scenario of the tested server: if the application scene is image rendering, executing step 302; if the application scenario is data calculation, step 307 is performed.
Step 302, determining that the target operating system type of the virtual machine corresponding to the tested server is the first operating system type.
Step 303, installing a preset number of virtual machines in the tested server through a virtual machine deployment script corresponding to the first operating system type, and configuring each virtual machine.
Wherein the operating system type of each virtual machine is a first operating system type.
Step 304, detecting whether each virtual machine meets a preset test condition according to the type of the operating system of each virtual machine.
Step 305, if each virtual machine meets the preset test condition, determining that the function to be tested of each virtual machine is an image rendering function, and testing the image rendering function of each virtual machine through a test script corresponding to the image rendering function to obtain an image rendering function test result of each virtual machine.
And 306, determining the test result of the tested server according to the image rendering function test result of each virtual machine.
Step 307, determining that the target operating system type of the virtual machine corresponding to the tested server is the second operating system type.
And 308, installing a preset number of virtual machines in the tested server through the virtual machine deployment script corresponding to the second operating system type, and configuring each virtual machine.
Wherein the operating system type of each virtual machine is a second operating system type.
Step 309, detecting whether each virtual machine meets a preset test condition according to the operating system type of each virtual machine.
Step 310, if each virtual machine meets the preset test condition, determining that the function to be tested of each virtual machine is a bandwidth function, a communication function and/or a calculation function, and testing the bandwidth function, the communication function and/or the calculation function of each virtual machine through test scripts corresponding to the bandwidth function, the communication function and/or the calculation function to obtain a bandwidth function test result, a communication function test result and/or a calculation function test result of each virtual machine.
Step 311, determining a test result of the tested server according to the bandwidth function test result, the communication function test result and/or the calculation function test result of each virtual machine.
According to the technical scheme of the embodiment of the invention, after the operating system type of the virtual machine needing to be installed and configured in the server is determined according to the application scene of the server, a plurality of virtual machines are automatically installed and configured in the server based on the virtual machine deployment script corresponding to the operating system type of the virtual machine needing to be installed and configured in the server, the server is virtualized, whether each virtual machine can perform functional test can be detected according to the operating system type of each virtual machine, after the virtual machines can perform functional test is determined, the service function needing to be used in the running process of each virtual machine is determined according to the operating system type of each virtual machine, after the service function needing to be used in the running process of each virtual machine is determined to be an image rendering function, whether the image rendering function of each virtual machine is normal or not is determined based on the test script corresponding to the image rendering function, whether the virtualized server can stably run or not is determined, whether the service function needing to be used in the running process of the virtual machine is a bandwidth function, a communication function and a communication function can be determined after the communication function and a communication function can be performed on the communication function and the communication function of each virtual machine which are stable, and whether the communication function can be performed on the communication function and the communication function can be determined.
Example IV
Fig. 4 is a schematic structural diagram of a server testing device according to a fourth embodiment of the present invention. The apparatus may be configured in an electronic device. As shown in fig. 4, the apparatus includes: a type determination module 401, a virtual machine deployment module 402, a condition detection module 403, a functional test module 404, and a result determination module 405.
The type determining module 401 is configured to determine, according to an application scenario of a server to be tested, a target operating system type corresponding to the server to be tested; a virtual machine deployment module 402, configured to install a preset number of virtual machines in the tested server through a virtual machine deployment script corresponding to the target operating system type, and configure each virtual machine; wherein the operating system type of each virtual machine is the target operating system type; a condition detection module 403, configured to detect whether each virtual machine meets a preset test condition; the function test module 404 is configured to determine, if each virtual machine meets the preset test condition, a function to be tested of each virtual machine according to the target operating system type, and test the function to be tested of each virtual machine through a test script corresponding to the function to be tested, so as to obtain a function test result of each virtual machine; and the result determining module 405 is configured to determine a test result of the tested server according to a functional test result of each virtual machine.
According to the technical scheme, the type of the target operating system corresponding to the tested server is determined according to the application scene of the tested server; then installing a preset number of virtual machines in a tested server through a virtual machine deployment script corresponding to the type of the target operating system, and configuring each virtual machine; detecting whether each virtual machine meets a preset test condition; if each virtual machine meets the preset test conditions, determining the function to be tested of each virtual machine according to the type of the target operating system, and testing the function to be tested of each virtual machine through a test script corresponding to the function to be tested to obtain a function test result of each virtual machine; and finally, determining the test result of the tested server according to the function test result of each virtual machine, solving the problems that a server test scheme in the related technology depends on manual operation of testers, consumes a great amount of labor cost and time cost, has lower test efficiency and cannot guarantee test accuracy.
In an optional implementation manner of the embodiment of the present invention, optionally, the type determining module 401 is specifically configured to: acquiring an application scene of a tested server input by a target user through a test management page; if the application scene is image rendering, determining that the target operating system type corresponding to the tested server is a first operating system type; and if the application scene is data calculation, determining that the target operating system type corresponding to the tested server is a second operating system type.
In an optional implementation manner of the embodiment of the present invention, optionally, the virtual machine deployment module 402 is specifically configured to: detecting whether a virtual machine deployment script corresponding to the type of the target operating system exists in a local database; if yes, virtual machine deployment scripts corresponding to the target operating system type are obtained from the local database, a preset number of virtual machines are installed in the tested server through the virtual machine deployment scripts, and configuration is carried out on each virtual machine.
In an optional implementation of the embodiment of the present invention, optionally, the virtual machine deployment module 402 is further configured to: if not, downloading a virtual machine deployment script corresponding to the target operating system type according to the script downloading address of the target operating system type, installing a preset number of virtual machines in the tested server through the virtual machine deployment script, and configuring each virtual machine.
In an optional implementation manner of the embodiment of the present invention, optionally, the functional test module 404 is specifically configured to: if the target operating system type is the first operating system type, determining that the function to be tested of each virtual machine is an image rendering function; and testing the image rendering function of each virtual machine through a test script corresponding to the image rendering function to obtain an image rendering function test result of each virtual machine.
In an optional implementation manner of the embodiment of the present invention, optionally, the functional test module 404 is specifically configured to: if the target operating system type is the second operating system type, determining that the function to be tested of each virtual machine is a bandwidth function, a communication function and/or a calculation function; and testing the bandwidth function, the communication function and/or the calculation function of each virtual machine through test scripts corresponding to the bandwidth function, the communication function and/or the calculation function to obtain a bandwidth function test result, a communication function test result and/or a calculation function test result of each virtual machine.
In an optional implementation manner of the embodiment of the present invention, optionally, the condition detection module 403 is specifically configured to: and detecting whether each virtual machine meets a preset test condition according to the type of the operating system of each virtual machine.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
The server testing device can execute the server testing method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of executing the server testing method.
Example five
Fig. 5 shows a schematic diagram of an electronic device 10 that may be used to implement the server testing method of an embodiment of the present invention. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 5, the electronic device 10 includes at least one processor 11, and a memory such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., which is in network communication connection with the at least one processor 11, wherein the memory stores a computer program executable by the at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program built into the Random Access Memory (RAM) 13 from the storage unit 18. In the RAM 13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
Various components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, etc.; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as the server test method.
In some embodiments, the server testing method may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When a computer program is built into RAM 13 and executed by processor 11, one or more steps of the server testing method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the server test method in any other suitable manner (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
The computer program used to implement the server testing method of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (10)

1. A server testing method, comprising:
determining a target operating system type corresponding to a tested server according to an application scene of the tested server;
installing a preset number of virtual machines in the tested server through a virtual machine deployment script corresponding to the type of the target operating system, and configuring each virtual machine; wherein the operating system type of each virtual machine is the target operating system type;
Detecting whether each virtual machine meets a preset test condition;
if the virtual machines meet the preset test conditions, determining the functions to be tested of the virtual machines according to the target operating system types, and testing the functions to be tested of the virtual machines through test scripts corresponding to the functions to be tested to obtain function test results of the virtual machines;
and determining the test result of the tested server according to the function test result of each virtual machine.
2. The server testing method according to claim 1, wherein determining a target operating system type corresponding to a server under test according to an application scenario of the server under test includes:
acquiring an application scene of a tested server input by a target user through a test management page;
if the application scene is image rendering, determining that the target operating system type corresponding to the tested server is a first operating system type;
and if the application scene is data calculation, determining that the target operating system type corresponding to the tested server is a second operating system type.
3. The server testing method according to claim 1, wherein installing a preset number of virtual machines in the server under test by a virtual machine deployment script corresponding to the target operating system type, and configuring each of the virtual machines, comprises:
Detecting whether a virtual machine deployment script corresponding to the type of the target operating system exists in a local database;
if yes, virtual machine deployment scripts corresponding to the target operating system type are obtained from the local database, a preset number of virtual machines are installed in the tested server through the virtual machine deployment scripts, and configuration is carried out on each virtual machine.
4. The server testing method according to claim 3, further comprising, after detecting whether a virtual machine deployment script corresponding to the target operating system type exists in a local database:
if not, downloading a virtual machine deployment script corresponding to the target operating system type according to the script downloading address of the target operating system type, installing a preset number of virtual machines in the tested server through the virtual machine deployment script, and configuring each virtual machine.
5. The server testing method according to claim 2, wherein determining the function to be tested of each virtual machine according to the target operating system type, testing the function to be tested of each virtual machine by a test script corresponding to the function to be tested, and obtaining a function test result of each virtual machine, includes:
If the target operating system type is the first operating system type, determining that the function to be tested of each virtual machine is an image rendering function;
and testing the image rendering function of each virtual machine through a test script corresponding to the image rendering function to obtain an image rendering function test result of each virtual machine.
6. The server testing method according to claim 2, wherein determining the function to be tested of each virtual machine according to the target operating system type, testing the function to be tested of each virtual machine by a test script corresponding to the function to be tested, and obtaining a function test result of each virtual machine, includes:
if the target operating system type is the second operating system type, determining that the function to be tested of each virtual machine is a bandwidth function, a communication function and/or a calculation function;
and testing the bandwidth function, the communication function and/or the calculation function of each virtual machine through test scripts corresponding to the bandwidth function, the communication function and/or the calculation function to obtain a bandwidth function test result, a communication function test result and/or a calculation function test result of each virtual machine.
7. The server testing method according to claim 1, wherein detecting whether each of the virtual machines satisfies a preset test condition includes:
and detecting whether each virtual machine meets a preset test condition according to the type of the operating system of each virtual machine.
8. A server testing apparatus, comprising:
the type determining module is used for determining the type of a target operating system corresponding to the tested server according to the application scene of the tested server;
the virtual machine deployment module is used for installing a preset number of virtual machines in the tested server through a virtual machine deployment script corresponding to the type of the target operating system, and configuring each virtual machine; wherein the operating system type of each virtual machine is the target operating system type;
the condition detection module is used for detecting whether each virtual machine meets a preset test condition;
the function test module is used for determining the function to be tested of each virtual machine according to the type of the target operating system if each virtual machine meets the preset test condition, and testing the function to be tested of each virtual machine through a test script corresponding to the function to be tested to obtain a function test result of each virtual machine;
And the result determining module is used for determining the test result of the tested server according to the function test result of each virtual machine.
9. An electronic device, the electronic device comprising:
at least one processor;
and a memory communicatively coupled to the at least one processor network;
wherein the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the server testing method of any one of claims 1-7.
10. A computer readable storage medium storing computer instructions for causing a processor to implement the server testing method of any one of claims 1-7 when executed.
CN202311433776.8A 2023-10-31 2023-10-31 Server testing method, device, equipment and medium Pending CN117520080A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311433776.8A CN117520080A (en) 2023-10-31 2023-10-31 Server testing method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311433776.8A CN117520080A (en) 2023-10-31 2023-10-31 Server testing method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN117520080A true CN117520080A (en) 2024-02-06

Family

ID=89757664

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311433776.8A Pending CN117520080A (en) 2023-10-31 2023-10-31 Server testing method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN117520080A (en)

Similar Documents

Publication Publication Date Title
CN114064208A (en) Method and device for detecting application service state, electronic equipment and storage medium
CN114389969A (en) Client test method and device, electronic equipment and storage medium
CN113609027A (en) ARM cloud server testing method and device, electronic equipment and storage medium
CN115481594B (en) Scoreboard implementation method, scoreboard, electronic equipment and storage medium
CN116467161A (en) Application testing method and device, electronic equipment and storage medium
CN117520080A (en) Server testing method, device, equipment and medium
CN115061921A (en) Automatic test method, device, electronic equipment and readable storage medium
CN116303074A (en) Server testing method, device, equipment and medium
CN116449810B (en) Fault detection method and device, electronic equipment and storage medium
CN116149709A (en) Firmware upgrading method, device, equipment and medium
CN113656268B (en) Performance test method and device for business service, electronic equipment and storage medium
CN117061564A (en) Verification method, device, equipment and medium for vehicle signal transmission state
CN116303098A (en) Application testing method and device, electronic equipment and storage medium
CN116303071A (en) Interface testing method and device, electronic equipment and storage medium
CN117609064A (en) Unit test method and device, electronic equipment and storage medium
CN117687853A (en) Firmware detection method, device, equipment and medium
CN117609087A (en) Code processing method, device, equipment and medium
CN117234601A (en) System starting method and device, electronic equipment and storage medium
CN116521536A (en) Code coverage rate determining method and device, electronic equipment and storage medium
CN115543712A (en) Automatic detection method and device for equipment configuration information, electronic equipment and medium
CN116307551A (en) Automatic bill conversion method and device, electronic equipment and storage medium
CN115757275A (en) Asset information management method and device, electronic equipment and storage medium
CN115604091A (en) Data processing method and device, substrate control management system and electronic equipment
CN117609801A (en) Data comparison method, device, equipment and medium
CN117234736A (en) Instruction processing method, device, equipment and medium

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