Server acceptance test method and device, electronic equipment and storage medium

By installing pressure testing tools on the target virtual machine and using pressurized scripts to control load scenarios, the server acceptance test is fully automated, solving the complex and redundant acceptance test problems in the existing technology, and simplifying the testing process.

CN119201667APending Publication Date: 2024-12-27BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310770606.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-27
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

Existing server acceptance tests are mostly manual or semi-automated, resulting in complex stability tests and redundant operation. Performance tests require manual installation of pressurization tools, which are cumbersome to configure and complex to use.

Method used

By installing a pressure test tool on the target virtual machine, using pressurized scripts to control the load scenarios, perform performance tests automatically, and generate acceptance test results based on the test results to achieve fully automatic acceptance tests.

Benefits of technology

It realizes full automation of server acceptance testing, reduces manual participation, simplifies the installation and configuration of stress testing tools, and reduces test complexity and redundancy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119201667A_ABST
    Figure CN119201667A_ABST
Patent Text Reader

Abstract

The invention provides a server acceptance test method and device, electronic equipment and a storage medium, and the method comprises the steps: creating a target virtual machine in a target server; under the condition that the target virtual machine is in the running state, a pressure testing tool is installed on the target virtual machine; controlling a pressure test tool through a pressurization script corresponding to the target virtual machine, pressurizing the target virtual machine, and obtaining a target load virtual machine running in a target load scene indicated by the pressurization script; testing the target load virtual machine through a target test case corresponding to the target load virtual machine, and obtaining a target test result of the target load virtual machine; and obtaining an acceptance test result of the target server according to the target test result. Through the server stability testing method and device, the technical problems that a server stability testing process is complex, operation is redundant, repeatability is high, and a pressurizing tool is tedious in configuration and complex in use in the prior art are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of cloud service technology, and in particular to a server acceptance test method and device, electronic equipment and storage medium. Background Art

[0002] Before the server goes online, in order to verify whether the server can meet the requirements of the business layer, the following tests need to be performed on the server before going online:

[0003] 1. Adaptation acceptance test and stability test between the host's underlying kernel (i.e., real-time operating system), qemu-kvm (a simulator), libvirt (an open source API, background program, and management tool for managing virtualization platforms) and hardware;

[0004] 2. Acceptance test of cloud host functions and CPU, memory, IO, and network performance.

[0005] Currently, in the acceptance test of the host business layer, only the functional test of the cloud host (ie, the server providing cloud services) is automated, while the performance test is manual or semi-automated.

[0006] Currently, the acceptance test of the server has the following defects:

[0007] 1. Server acceptance testing is mostly manual or semi-automated, especially the server stability testing process is complex, with redundant operations and high repetitiveness.

[0008] 2. During the performance test, one or more pressurization tools need to be manually installed, which is cumbersome to configure and complex to use.

[0009] Therefore, the related art has the problems as described above. Summary of the invention

[0010] The present application provides a server acceptance test method and device, an electronic device and a storage medium to at least solve at least one technical problem existing in the related art.

[0011] According to one aspect of an embodiment of the present application, a server acceptance test method is provided, including:

[0012] Create a target virtual machine in the target server;

[0013] When the target virtual machine is in a running state, installing a stress testing tool on the target virtual machine;

[0014] Controlling the stress testing tool through the stressing script corresponding to the target virtual machine, stressing the target virtual machine, and obtaining a target load virtual machine running under the target load scenario indicated by the stressing script;

[0015] Testing the target load virtual machine through the target test case corresponding to the target load virtual machine, and obtaining the target test result of the target load virtual machine;

[0016] According to the target test result, the acceptance test result of the target server is obtained.

[0017] Optionally, as in the aforementioned method, creating a target virtual machine in the target server includes:

[0018] In the target server, multiple target virtual machines are created in batches, wherein each of the multiple target virtual machines is created based on a unique image file.

[0019] Optionally, as in the aforementioned method, when the target virtual machine is in a running state, installing a stress testing tool on the target virtual machine includes:

[0020] By calling the nova API interface, the state of the target virtual machine is polled until the target virtual machine is in the running state, or, when the polling duration of the target virtual machine exceeds the preset polling duration, it is determined that the creation of the target virtual machine fails;

[0021] When it is determined that the target virtual machine is in a running state, a target elastic IP is bound to the target virtual machine, the target virtual machine is logged in through the target elastic IP, and the stress testing tool is installed on the target virtual machine.

[0022] Optionally, as in the aforementioned method, after obtaining the target load virtual machine running under the target load scenario indicated by the pressure script, the method further includes:

[0023] Check whether the actual load of the target load virtual machine meets the target load scenario;

[0024] When the actual load does not meet the target load scenario, the stress testing tool is controlled again by the stress script corresponding to the target load virtual machine to stress the target load virtual machine;

[0025] When the actual load meets the target load scenario, the target elastic IP is unbound from the target load virtual machine.

[0026] Optionally, as in the aforementioned method, after obtaining the target load virtual machine running under the target load scenario indicated by the pressure script, the method further includes:

[0027] Migrate the source virtual machine in the source server to the target server, and obtain the migration result corresponding to the target server;

[0028] Migrate the target virtual machine in the target load virtual machine to a designated server, and obtain a migration result corresponding to the target server;

[0029] The step of obtaining the acceptance test result of the target server according to the target test result includes:

[0030] Obtaining an acceptance test result of the target server according to the migration result, the migration result and the target test result;

[0031] The target load virtual machine in the target server is deleted.

[0032] Optionally, as in the aforementioned method, before creating the target virtual machine in the target server, the method further includes:

[0033] Building a Python code environment in the target server;

[0034] And install the preset toolkit required for the script to run.

[0035] Optionally, the method as described in any of the preceding items is characterized in that the method further comprises:

[0036] Storing the object code for implementing the method described in any of the preceding items in a remote code repository;

[0037] The configuration obtains the saving paths corresponding to the target code, the image file, the source server, the target server, the designated server and the acceptance test result respectively.

[0038] According to another aspect of an embodiment of the present application, a server acceptance test device is also provided, including:

[0039] A creation module is used to create a target virtual machine in the target server;

[0040] An installation module, used to install a stress testing tool on the target virtual machine when the target virtual machine is in a running state;

[0041] A pressure module, used to control the stress testing tool through a pressure script corresponding to the target virtual machine, to pressurize the target virtual machine, and to obtain a target load virtual machine running under a target load scenario indicated by the pressure script;

[0042] A test module, used to test the target load virtual machine through a target test case corresponding to the target load virtual machine, and obtain a target test result of the target load virtual machine;

[0043] The result module is used to obtain the acceptance test result of the target server according to the target test result.

[0044] According to another aspect of the embodiments of the present application, there is also provided an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; wherein the memory is used to store a computer program; and the processor is used to execute the method steps in any of the above embodiments by running the computer program stored in the memory.

[0045] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the method steps in any of the above embodiments when executed.

[0046] In the embodiment of the present application, the pressure test tool is controlled by the pressure script corresponding to the target virtual machine, the target virtual machine created in the target server is pressured, and the target load virtual machine running under the target load scenario indicated by the pressure script is obtained; after the target load virtual machine is tested by the target test case corresponding to the target load virtual machine and the target test result of the target load virtual machine is obtained, the acceptance test result of the target server can be obtained according to the target test result. Thus, the full automation of the server acceptance test can be realized without manual or semi-manual participation; and the installation of the pressure test tool can be realized through the pressure script, which can further liberate the manual work; further, in summary, it can solve the technical problems that the server acceptance test in the related technology is mostly manual or semi-automatic, resulting in a complex test process for server stability, redundant operations, high repetitiveness, and the need to manually install the pressure tool during the performance test, which is cumbersome to configure and complex to use. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0048] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0049] Figure 1 is a flow chart of an optional server acceptance test method according to an embodiment of the present application;

[0050] Figure 2 is a flow chart of another optional server acceptance test method according to an embodiment of the present application;

[0051] Figure 3 is a flow chart of another optional server acceptance test method according to an embodiment of the present application;

[0052] Figure 4 is a flow chart of another optional server acceptance test method according to an embodiment of the present application;

[0053] Figure 5 is a structural block diagram of an optional server acceptance test device according to an embodiment of the present application;

[0054] Figure 6 It is a structural block diagram of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0055] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0056] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0057] According to one aspect of an embodiment of the present application, a server acceptance test method is provided. Optionally, in this embodiment, the above-mentioned server acceptance test method can be applied to a hardware environment consisting of a terminal and a server. The server is connected to the terminal through a network, and can be used to provide services (such as advertising push services, application services, etc.) to the terminal or a client installed on the terminal. A database can be set on the server or independently of the server to provide data storage services for the server.

[0058] The above network may include but is not limited to at least one of the following: wired network, wireless network. The above wired network may include but is not limited to at least one of the following: wide area network, metropolitan area network, local area network, and the above wireless network may include but is not limited to at least one of the following: WIFI (Wireless Fidelity), Bluetooth. The terminal may not be limited to a PC, a mobile phone, a tablet computer, etc.

[0059] The server acceptance test method of the embodiment of the present application can be executed by the server, or by the terminal, or by both the server and the terminal. The terminal can also execute the server acceptance test method of the embodiment of the present application by the client installed thereon.

[0060] Taking the server acceptance test method in this embodiment executed by the server as an example, Figure 1 An optional server acceptance test method according to an embodiment of the present application includes the following steps:

[0061] Step S101, creating a target virtual machine in a target server;

[0062] The server acceptance test method in this embodiment can be applied to a scenario where an automatic acceptance test is performed on a server to be accepted.

[0063] In this embodiment, the performance of the target server is indirectly measured by testing the virtual machine created in the target server.

[0064] One or more target virtual machines can be created in the target server. Generally, in order to meet different business needs, the server will create multiple virtual machines in actual applications. Therefore, during the acceptance test of the target server, multiple target virtual machines are also created in it.

[0065] As an optional embodiment, as in the above method, step S101 creates a target virtual machine in the target server, including:

[0066] In the target server, multiple target virtual machines are created in batches, wherein each of the multiple target virtual machines is created based on a unique image file.

[0067] Optionally, in order to better test the performance of the target server, the types of virtual machine images tested need to be as wide as possible. Therefore, multiple target virtual machines are created in batches in the target server. Each target virtual machine is created by a corresponding image file, and the image files corresponding to different target virtual machines are generally different. Therefore, Linux image virtual hosts and Windows image virtual hosts of different image versions can be created in batches. Preferably, Linux images can include but are not limited to centos, ubuntu, debian, and Fedora; Windows images can include but are not limited to: Chinese and English versions of Windows08, Windows12, Windows16, and Windows19.

[0068] Step S102: When the target virtual machine is in a running state, a stress testing tool is installed on the target virtual machine.

[0069] After the target virtual machine is created, it will not be in the running state (ie, active state) immediately after being created, and the tool for performing stress testing on the target virtual machine can only be used when the target virtual machine is in the running state.

[0070] For example, the stress testing tools installed on the target virtual machine may include, but are not limited to: chaosblade (a chaos experiment injection tool), cpu_burn (a CPU stress testing tool), testlimit64.exe (a stress testing tool for creating approximately 6,600 threads), fio (an I / O tool for stress testing and verifying hardware), iperf3.exe (a network performance testing tool), ntttcp.exe (another network performance testing tool), etc.

[0071] Step S103, controlling the stress test tool through the stress script corresponding to the target virtual machine, stressing the target virtual machine, and obtaining the target load virtual machine running under the target load scenario indicated by the stress script.

[0072] That is, in this embodiment, by executing the stress test script, the stress test tool is automatically controlled, and then the target virtual machine is stressed on the load, so as to obtain the target load virtual machine obtained after the target virtual machine runs under the target load scenario. That is, the target load virtual machine is the target virtual machine running under the target load scenario.

[0073] When there are multiple target virtual machines, different target virtual machines may correspond to different target load scenarios, and the target load scenarios may include but are not limited to: no load, full load, jump load, gradual load, IO load, network load, etc.

[0074] When the method of this embodiment is implemented based on the Python code environment, different load scenarios need to be implemented through different codes.

[0075] Step S104, testing the target load virtual machine through the target test case corresponding to the target load virtual machine, and obtaining the target test result of the target load virtual machine.

[0076] After obtaining the target load virtual machine, the target load virtual machine can be tested to determine whether it can run stably under the target load scenario.

[0077] In this embodiment, the target load virtual machine is tested through the target test case corresponding to the target load virtual machine, thereby determining whether the target load virtual machine can run normally and / or whether the performance of the target load virtual machine is stable.

[0078] Optionally, you can write target test cases corresponding to the target virtual machine through nose and pytest frameworks, and set corresponding checkpoints for the mainstream test scenarios of the target server acceptance and / or the business corresponding to the target virtual machine. Checkpoints may include but are not limited to: 1. Page link check: whether each link has a corresponding page, and the switching between pages is correct; 2. Correlation check: whether deleting / adding an item will affect other items, and if so, whether these effects are correct; 3. Check whether the functions of buttons are correct: such as update, cancel, delete, save, etc.; 4. String length check: input content that exceeds the string length specified by the requirements to see whether the system checks the string length and whether there will be errors; 5. Character type check, etc.

[0079] Generally speaking, different target virtual machines need to be tested through different target test cases.

[0080] Furthermore, after testing the target load virtual machine through the target test case, the inspection sub-result corresponding to each checkpoint can be obtained, that is, whether the test result corresponding to each checkpoint is given or whether it is wrong, and then whether the target load virtual machine can operate normally; as well as information such as the execution time of the target test case, to determine whether the performance of the target load virtual machine is stable; and then the target test result is obtained from all inspection sub-results.

[0081] The target test result can indicate whether the target virtual machine can run normally and / or whether the performance is stable under the target load scenario.

[0082] Step S105, obtaining the acceptance test result of the target server according to the target test result.

[0083] After obtaining the target test result, the acceptance test result for the target server can be obtained according to the target test result output, wherein the acceptance test result can be a report including the target test result.

[0084] Furthermore, after the acceptance test result is generated, the acceptance test result may be sent to a preset tester, so that the tester can view the result of the acceptance test on the target server via email.

[0085] Through the method in this embodiment, the pressure test tool is controlled by the pressure script corresponding to the target virtual machine, the target virtual machine created in the target server is pressured, and the target load virtual machine running under the target load scenario indicated by the pressure script is obtained; after the target load virtual machine is tested by the target test case corresponding to the target load virtual machine and the target test result of the target load virtual machine is obtained, the acceptance test result of the target server can be obtained according to the target test result. Thus, the full automation of the server acceptance test can be realized without manual or semi-manual participation; and the installation of the pressure test tool can be realized through the pressure script, which can further liberate the manual work; further, in summary, it can solve the technical problems that the server acceptance test in the related technology is mostly manual or semi-automatic, resulting in a complex test process for server stability, redundant operations, high repetitiveness, and the need to manually install the pressure tool during the performance test, which is cumbersome to configure and complex to use.

[0086] As an optional embodiment, as in the above method, before creating the target virtual machine in the target server in step S101, the method further includes the following steps:

[0087] Build a Python code environment in the target server;

[0088] And install the preset toolkit required for the script to run.

[0089] In this embodiment, the Python code environment can be built in each target server in sequence, and then after determining that the Python code environment is built, the preset toolkit required for the script to run is installed. For example, the preset toolkit can include but is not limited to: requests (a Python HTTP client library), pytest (a full-featured Python testing tool that can help write better programs, not only for writing small tests, but also for expanding to complex functional tests), paramiko (a third-party library belonging to Python, which can remotely connect to a Linux server and operate Linux through Python, and can realize download and upload file operations on a remote server).

[0090] By using the method in this embodiment, an environment in which the script can be run can be quickly and automatically built, so that the acceptance test of the target server can be automatically implemented later.

[0091] like Figure 2 As shown, as an optional embodiment, as in the above method, the step S102 installs a stress test tool on the target virtual machine when the target virtual machine is in a running state, including the following steps:

[0092] Step S201, by calling the nova API interface, polling the state of the target virtual machine until the target virtual machine is in a running state, or, when the polling duration of the target virtual machine exceeds a preset polling duration, determining that the creation of the target virtual machine has failed.

[0093] In this embodiment, the nova API interface (a RESTful API service based on HTTP for receiving and processing external HTTP requests) can be called to batch create target virtual machines of different images in the target server in a multi-threaded manner. Since the target virtual machine will not be in the active state (i.e., running state) immediately after creation, the interface is repeatedly called to query the state of the target virtual machine after creation until all target virtual machines in the target server are in the active state or one or more of the target virtual machines exceed the preset polling duration (which can be set according to the general time required for the virtual machine to be in the active state from creation. Generally, the polling duration is longer than the required duration, which is not specifically limited in this embodiment).

[0094] When the polling time for the target virtual machine exceeds the preset polling time, it is determined that the creation of the target virtual machine has failed. The target virtual machine that failed to be created and the target image file corresponding to the target virtual machine can be determined. After the target virtual machine is deleted, the virtual machine can be re-created in the target server through the target image file.

[0095] Step S202, when it is determined that the target virtual machine is in a running state, a target elastic IP is bound to the target virtual machine, and the target virtual machine is logged in through the target elastic IP, and a stress testing tool is installed on the target virtual machine.

[0096] When it is determined that the target virtual machine is in a running state, bind the target elastic IP (Elastic IP Address, referred to as EIP, is a public IP address resource that can be purchased and held independently) to the target virtual machine.

[0097] When there are multiple target virtual machines, a unique target elastic IP is bound to each target virtual machine.

[0098] After binding the target elastic IP to the target virtual machine, you can log in to the target virtual machine through the target elastic IP. When there are multiple target virtual machines, you can log in to each Linux target virtual machine and Windows target virtual machine according to the target elastic IP corresponding to each Linux target virtual machine and Windows target virtual machine, and upload and install the stress testing tool in each Linux target virtual machine and Windows target virtual machine.

[0099] Through the method in this embodiment, during the server acceptance test process, the stress testing tool can be automatically installed on the virtual machine, thereby overcoming the technical problems of manually installing multiple stress testing tools in related technologies, resulting in cumbersome configuration and complex use.

[0100] like Figure 3 As shown, as an optional embodiment, as in the above method, after obtaining the target load virtual machine running under the target load scenario indicated by the pressure script in step S103, the method further includes the following steps:

[0101] Step S301, checking whether the actual load of the target load virtual machine meets the target load scenario.

[0102] The target load scenario can be information used to indicate the load that each target load virtual machine in the target server needs to achieve, for example: the CPU load reaches 70%, the memory load reaches 80%, etc. In the same target load scenario, the loads that different target load virtual machines need to achieve may be different.

[0103] The actual load of the target load virtual machine can be obtained by detecting the current load condition of the target load virtual machine.

[0104] After the actual load is obtained, the actual load can be compared with the target load scenario to determine whether the actual load meets the target load scenario.

[0105] In this embodiment, since the actual load is difficult to be completely consistent with the target load scenario, the actual load is determined to meet the target load scenario as long as the deviation between the actual load and the target load scenario meets a preset range (for example, 5%).

[0106] Step S302: When the actual load does not meet the target load scenario, the pressure testing tool is controlled again through the pressure increase script corresponding to the target load virtual machine to increase the pressure on the target load virtual machine.

[0107] If it is determined that the actual load does not meet the target load scenario, the aforementioned steps may be performed again to control the stress test tool through the stress script corresponding to the target load virtual machine to stress the target load virtual machine.

[0108] Specifically, you can execute a shell script (Linux) or a ps1 script (Windows) to continuously apply pressure to the target virtual machine (for example, CPU, memory, disk, network), and put the target virtual machine in different load scenarios such as no load, full load, jump load, gradual load, IO load, network load, etc.

[0109] Step S303, when the actual load meets the target load scenario, unbind the target elastic IP from the target load virtual machine.

[0110] When it is determined that the actual load meets the target load scenario, the target elastic IP can be unbound from the target load virtual machine, thereby releasing the elastic IP so that it can be bound to other virtual machines later.

[0111] Through the method in this embodiment, the purpose of judging the actual load of the target load virtual machine can be achieved, thereby ensuring that the target load virtual machine is subsequently tested under the target load scenario, thereby improving the accuracy of the test on the target server.

[0112] like Figure 4 As shown, as an optional embodiment, as in the above method, after obtaining the target load virtual machine running under the target load scenario indicated by the pressure script in step S103, the method further includes the following steps:

[0113] Step S401, migrate the source virtual machine in the source server to the target server, and obtain the migration result corresponding to the target server.

[0114] Generally, when performing server acceptance testing, multiple servers in the same batch will be tested.

[0115] The source server and the designated server are other servers in the same batch as the target server. The source server can be the same as the designated server or different.

[0116] Therefore, virtual machines are also created in the source server and the specified server.

[0117] The source virtual machine is a virtual machine created in the original server. In this embodiment, the source virtual machine is migrated from the source server to the target server, so that the performance of the target server in performing virtual machine migration under the target load scenario, that is, the migration result, can be obtained.

[0118] Step S402, migrating the target virtual machine in the target load virtual machine to the designated server, and obtaining the migration result corresponding to the target server.

[0119] In this embodiment, the target virtual machine in the target load virtual machine can also be migrated to a designated server to obtain the performance of the target server in performing virtual machine migration under the target load scenario, that is, the migration result.

[0120] According to the target test results, the acceptance test results of the target server are obtained, including:

[0121] Step S403, obtaining the acceptance test result of the target server according to the migration result, the migration result and the target test result.

[0122] That is, the acceptance test result of the target server may include a migration result, a migration result, and a target test result.

[0123] Optionally, by adopting the allure module (a toolkit for Python, a flexible and lightweight multi-language test report tool), an acceptance test report as an acceptance test result can be generated based on the above-mentioned migration results, migration results and target test results.

[0124] This can overcome the technical problem in the related art that the test results after manual or semi-automatic testing cannot generate a test report and have low readability.

[0125] Step S404, deleting the target load virtual machine in the target server.

[0126] After completing the acceptance test on the target server, in order to avoid occupying resources, you can batch delete the target load virtual machines corresponding to each image in the target server.

[0127] Through the method in the embodiment, the server can also be automatically tested when migrating virtual machines in and out, and the acceptance test results of the target server can be obtained based on all migration results, migration results and target test results to achieve a more comprehensive acceptance test.

[0128] As an optional embodiment, as in any of the preceding methods, the method further comprises the following steps:

[0129] Storing the object code for implementing any of the methods in the preceding items in a remote code repository;

[0130] The configuration obtains the saving paths corresponding to the target code, image file, source server, target server, designated server and acceptance test results respectively.

[0131] In this embodiment, the target code for implementing any of the previous methods may be uploaded to a remote code repository such as gitlab, github, etc., and stored.

[0132] In addition, you can use Jenkins (an open source software project, a continuous integration tool developed based on Java, used to monitor continuous repetitive work, aiming to provide an open and easy-to-use software platform for continuous integration of software projects) to perform the following configurations: configure key parameters such as the image file to be tested, the source server, the target server, the code address of the target code, and the save path of the generated report.

[0133] Through the method in this embodiment, the target code can be saved, and the save paths corresponding to the target code, mirror file, source server, target server, designated server and acceptance test results can be determined respectively; thereby making it easier to uniformly manage and use the target code, mirror file, source server, target server, designated server and acceptance test results in the later stage.

[0134] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0135] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM (Read-Only Memory) / RAM (Random Access Memory), a disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0136] According to another aspect of an embodiment of the present application, a server acceptance test device for implementing the above-mentioned server acceptance test method is also provided. Figure 5 is a structural block diagram of an optional server acceptance test device according to an embodiment of the present application, such as Figure 5 As shown, the device may include:

[0137] Creation module 1, used to create a target virtual machine in the target server;

[0138] Installation module 2, used to install a stress test tool on the target virtual machine when the target virtual machine is in a running state;

[0139] Pressure module 3, used to control the pressure test tool through the pressure script corresponding to the target virtual machine, pressurize the target virtual machine, and obtain the target load virtual machine running under the target load scenario indicated by the pressure script;

[0140] Testing module 4 is used to test the target load virtual machine through the target test case corresponding to the target load virtual machine, and obtain the target test result of the target load virtual machine under the target load scenario;

[0141] The result module 5 is used to obtain the acceptance test result of the target server according to the target test result.

[0142] It should be noted that the creation module 1 in this embodiment can be used to execute the above step S101, the installation module 2 in this embodiment can be used to execute the above step S102, the pressurization module 3 in this embodiment can be used to execute the above step S103, the test module 4 in this embodiment can be used to execute the above step S104, and the result module 5 in this embodiment can be used to execute the above step S105.

[0143] The device in this embodiment, in addition to the above modules, may also include a module for executing any method in any of the above-mentioned server acceptance test method embodiments.

[0144] It should be noted that the above modules and corresponding steps implement the same examples and application scenarios, but are not limited to the contents disclosed in the above embodiments. It should be noted that the above modules, as part of the device, can be run in the implementation of Figure 1 The hardware environment of the method shown may be implemented by software or hardware, wherein the hardware environment includes a network environment.

[0145] According to another aspect of an embodiment of the present application, an electronic device for implementing the above-mentioned server acceptance test method is also provided. The electronic device may be a server, a terminal, or a combination thereof.

[0146] According to another embodiment of the present application, there is also provided an electronic device, including: Figure 6 As shown, the electronic device may include: a processor 1501 , a communication interface 1502 , a memory 1503 and a communication bus 1504 , wherein the processor 1501 , the communication interface 1502 , and the memory 1503 communicate with each other via the communication bus 1504 .

[0147] Memory 1503, used for storing computer programs;

[0148] The processor 1501 is used to implement the following steps when executing the program stored in the memory 1503:

[0149] Step S101, creating a target virtual machine in a target server.

[0150] Step S102: When the target virtual machine is in a running state, a stress testing tool is installed on the target virtual machine.

[0151] Step S103, controlling the stress test tool through the stress script corresponding to the target virtual machine, stressing the target virtual machine, and obtaining the target load virtual machine running under the target load scenario indicated by the stress script.

[0152] Step S104, testing the target load virtual machine through the target test case corresponding to the target load virtual machine, and obtaining the target test result of the target load virtual machine.

[0153] Step S105, obtaining the acceptance test result of the target server according to the target test result.

[0154] Optionally, in this embodiment, the above-mentioned communication bus can be a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The communication interface is used for communication between the above-mentioned electronic device and other devices.

[0155] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0156] The above-mentioned processor can be a general-purpose processor, which can include but not be limited to: CPU (Central Processing Unit), NP (Network Processor), etc.; it can also be DSP (Digital Signal Processor), ASIC (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0157] An embodiment of the present application further provides a computer-readable storage medium, the storage medium including a stored program, wherein the method steps of the above method embodiment are executed when the program is run.

[0158] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a ROM, a RAM, a mobile hard disk, a magnetic disk, or an optical disk.

[0159] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0160] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.

[0161] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0162] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0163] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution provided in this embodiment.

[0164] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0165] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A server acceptance test method, characterized in that: include: Create a target virtual machine in the target server; When the target virtual machine is in a running state, installing a stress testing tool on the target virtual machine; Controlling the stress testing tool through the stressing script corresponding to the target virtual machine, stressing the target virtual machine, and obtaining a target load virtual machine running under the target load scenario indicated by the stressing script; Testing the target load virtual machine through the target test case corresponding to the target load virtual machine, and obtaining the target test result of the target load virtual machine; According to the target test result, the acceptance test result of the target server is obtained.

2. The method according to claim 1, characterized in that The step of creating a target virtual machine in the target server includes: In the target server, multiple target virtual machines are created in batches, wherein each of the multiple target virtual machines is created based on a unique image file.

3. The method according to claim 1, characterized in that When the target virtual machine is in a running state, installing a stress testing tool on the target virtual machine includes: By calling the nova API interface, the state of the target virtual machine is polled until the target virtual machine is in the running state, or, when the polling duration of the target virtual machine exceeds the preset polling duration, it is determined that the creation of the target virtual machine fails; When it is determined that the target virtual machine is in a running state, a target elastic IP is bound to the target virtual machine, the target virtual machine is logged in through the target elastic IP, and the stress testing tool is installed on the target virtual machine.

4. The method according to claim 3, characterized in that After obtaining the target load virtual machine running under the target load scenario indicated by the pressure script, the method further includes: Check whether the actual load of the target load virtual machine meets the target load scenario; When the actual load does not meet the target load scenario, the stress testing tool is controlled again by the stress script corresponding to the target load virtual machine to stress the target load virtual machine; When the actual load meets the target load scenario, the target elastic IP is unbound from the target load virtual machine.

5. The method according to claim 1, characterized in that After obtaining the target load virtual machine running under the target load scenario indicated by the pressure script, the method further includes: Migrate the source virtual machine in the source server to the target server, and obtain the migration result corresponding to the target server; Migrate the target virtual machine in the target load virtual machine to a designated server, and obtain a migration result corresponding to the target server; The step of obtaining the acceptance test result of the target server according to the target test result includes: Obtaining an acceptance test result of the target server according to the migration result, the migration result and the target test result; The target load virtual machine in the target server is deleted.

6. The method according to claim 1, characterized in that Before creating the target virtual machine in the target server, the method further includes: Building a Python code environment in the target server; And install the preset toolkit required for the script to run.

7. The method according to any one of claims 1 to 6, characterized in that The method further comprises: Storing the target code for implementing the method described in any one of claims 1 to 6 in a remote code repository; The configuration obtains the saving paths corresponding to the target code, the image file, the source server, the target server, the designated server and the acceptance test result respectively.

8. A server acceptance test device, characterized in that: include: A creation module is used to create a target virtual machine in the target server; An installation module, used to install a stress testing tool on the target virtual machine when the target virtual machine is in a running state; A pressure module, used to control the stress testing tool through a pressure script corresponding to the target virtual machine, to pressurize the target virtual machine, and to obtain a target load virtual machine running under a target load scenario indicated by the pressure script; A test module, used to test the target load virtual machine through a target test case corresponding to the target load virtual machine, and obtain a target test result of the target load virtual machine; The result module is used to obtain the acceptance test result of the target server according to the target test result.

9. An electronic device comprising a processor, a communication interface, a memory and a communication bus, wherein: The processor, the communication interface and the memory communicate with each other via the communication bus, wherein: The memory is used to store computer programs; The processor is configured to execute the method steps of any one of claims 1 to 7 by running the computer program stored in the memory.

10. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the method steps described in any one of claims 1 to 7 when run.