Server test method and device, electronic equipment and storage medium
By obtaining configuration information and resource requirements during the server testing process, selecting compatible parallel test cases and scheduling to a suitable server, the problem of poor server testing efficiency is solved, and more efficient resource utilization and testing reliability is achieved.
Patent Information
- Application Number
- CN202510493206.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-18
- Publication Date
- 2025-07-25
AI Technical Summary
During the server testing process, due to the unreasonable scheduling design of the cases to be tested, the server testing efficiency is not ideal and the testing resources of the server to be tested are not fully utilized.
By obtaining the configuration information of the server to be tested in the current test cluster and the test resource requirements of the cases to be tested, select parallel test cases that are compatible with each other, and schedule them to the server to be tested that meets the resource requirements for parallel testing.
It improves server testing efficiency and reliability, optimizes server resource utilization, reduces manual intervention and waiting time, and improves the accurate matching of test tasks and resource supply.
Smart Images

Figure CN120371706A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technologies, and in particular, to a server testing method, a server testing device, an electronic device, and a computer-readable storage medium. Background Art
[0002] Server automated testing is usually used to verify server resource competition and isolation capabilities. However, due to the unreasonable scheduling design of test cases to be tested during the server testing process, there is usually a situation where the server to be tested does not fully undertake the test tasks, so there is a slow server testing progress, which in turn leads to an unsatisfactory server testing efficiency. Summary of the Invention
[0003] This application provides a server testing method, a server testing device, an electronic device, and a computer-readable storage medium to at least solve the problem of unsatisfactory server testing efficiency in related technologies.
[0004] This application provides a server testing method, which includes: obtaining the configuration information of the server to be tested in the current test cluster; obtaining the test duration of the test case to be tested, and selecting a first test case and a second test case as parallel test cases; wherein, the test duration of the first test case is greater than or equal to that of the second test case, and the first test case is compatible with the second test case; scheduling the parallel test cases to the current server, and enabling the current server to execute the parallel test cases in parallel; wherein, the current server is the server to be tested whose configuration information meets the test resource requirements of the parallel test cases.
[0005] This application also provides a server testing device, which includes: a storage module and a management module; the storage module is used to store the configuration information of the server to be tested and the test resource requirements of the test case to be tested; the management module is connected to the storage module and is used to connect to the current test cluster to implement the above server testing method.
[0006] This application also provides an electronic device, which includes: a memory for storing a computer program; a processor for implementing the steps of the above server testing method when executing the computer program.
[0007] This application also provides a computer-readable storage medium, in which a computer program is stored, and wherein the computer program implements the steps of the above server testing method when executed by a processor.
[0008] Through this application, since the configuration information of the servers to be tested in the current test cluster and the test resource requirements of the test cases to be tested are pre-stored, the servers to be tested suitable for executing them are selected based on the test resource requirements of the test cases to be tested. At the same time, the test duration of the test cases to be tested is obtained, and multiple mutually compatible test cases to be tested are selected as parallel test cases based on the obtained test duration, and the parallel test cases are scheduled to a server to be tested that meets the test requirements of the parallel test cases for parallel testing of the parallel test cases. Therefore, the technical problem of unsatisfactory server test efficiency can be solved, and the technical effects of improving server test efficiency and reliability can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] To more clearly illustrate the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0010] Figure 1 Schematic diagram of an application scenario of an embodiment of the server testing device of the present application;
[0011] Figure 2 Schematic diagram of the structure of an embodiment of the server testing device of the present application;
[0012] Figure 3 Schematic diagram of the structure of an embodiment of the server testing system of the present application;
[0013] Figure 4 Schematic diagram of the process of an embodiment of the server testing method of the present application;
[0014] Figure 5 Schematic diagram of the process of another embodiment of the server testing method of the present application;
[0015] Figure 6 Schematic diagram of the structure of an embodiment of the storage module of the present application;
[0016] Figure 7 Schematic diagram of the structure of an embodiment of the current test cluster of the present application;
[0017] Figure 8 Schematic diagram of the structure of an embodiment of the electronic device of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0018] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the protection scope of the present application.
[0019] It should be noted that in the description of the present application, the terms "include", "comprise" or any other variation thereof are intended to cover a non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. The terms "first", "second", etc. in the present application are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0020] In order to enable those skilled in the art of the present technology to better understand the solution of the present application, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments.
[0021] Combined with the specific application environment architecture or specific hardware architecture on which the execution of the server testing method depends, the specific application environment architecture or specific hardware architecture will be described herein.
[0022] Please refer to Figure 1 , Figure 1 , which is a schematic diagram of the application scenario of an embodiment of the server testing device of the present application.
[0023] In one embodiment, the application scenario includes a test release device 10, a server testing device 20, and a server cluster 30.
[0024] As the name implies, the server testing device 20 is a device for testing the server. As an example of the application scenario where the server testing device 20 is located in Figure 1 , during the process of testing the server, usually there is a test release device 10 to release the test tasks of the server, and the server testing device 20 obtains the test tasks and schedules the server cluster 30 connected thereto to execute.
[0025] Among them, the server cluster 30 may include one or more server cabinets; or, the server cluster 30 may directly include multiple to-be-tested servers that can be used for server testing.
[0026] The server testing device 20 can schedule one or more test tasks, and when scheduling and executing the current test, it can schedule to form in the server cluster 30 as Figure 1The current test cluster exemplified herein. Initially, the current test cluster can generally include multiple servers to be tested. The servers to be tested within the current test cluster can be released from the current test cluster when the test task is completed, so as to allow the released servers to participate in other test tasks.
[0027] Optionally, the servers to be tested can be released from the current test cluster when the test task is completed. In this embodiment, the servers to be tested can also be dynamically released according to the number of remaining test cases to be tested. Specific examples will be given later and will not be elaborated here.
[0028] The specific structure and working principle of the server testing device will be elaborated below.
[0029] Please refer to Figure 2 , Figure 2 which is a schematic structural diagram of an embodiment of the server testing device of the present application.
[0030] In one embodiment, the server testing device 20 can include a storage module 21 and a management module 22.
[0031] The storage module 21 has a storage function, that is, it can be used to store data. That is to say, in this embodiment, it can be used to store the configuration information of the servers to be tested and the test resource requirements of the test cases to be tested.
[0032] The management module 22 is connected to the storage module 21 to be able to obtain the data stored in the storage module 21, that is, the configuration information of the servers to be tested and the test resource requirements of the test cases. The management module 22 can also be used to connect to the current test cluster to implement the server testing method.
[0033] The server testing method can at least include: obtaining the configuration information of the servers to be tested in the current test cluster; obtaining the test duration of the test cases to be tested, and selecting a first test case and a second test case as parallel test cases; wherein, the test duration of the first test case is greater than or equal to the test duration of the second test case, and the first test case and the second test case are compatible with each other; scheduling the parallel test cases to the current server, and making the current server execute the parallel test cases in parallel; wherein, the current server is a server to be tested whose configuration information meets the test resource requirements of the parallel test cases.
[0034] Taking the server cluster including multiple server cabinets as an example, the detailed architecture of the server testing device for server testing will be exemplified below.
[0035] Please refer to in combination Figure 1 and Figure 3 , Figure 3 which is a schematic structural diagram of an embodiment of the server testing system of the present application.
[0036] In one embodiment, the test publishing device 10 may include a web front-end 11, and the test task can be published to the server test device 20 through the web front-end 11. Optionally, the server test device 20 may also send the progress, results, etc. of the test task to the web front-end 11 for the user to view in real time.
[0037] For this reason, the server test device 20 may further include a first network connection service 23 and a second network connection service 24.
[0038] Among them, the first network connection service 23 is used to implement the communication connection between the server test device 20 and the test publishing device 10. The second network connection service 24 is used to implement the communication connection between the server test device 20 and the server cluster 30. For example, the first network connection service 23 and the second network connection service 24 can select SSH (Secure Shell), sftp (Secure Shell File Transfer Protocol), etc. For example, the server test device 20 and the server cluster 30 can be connected through SSH.
[0039] Furthermore, the back-end of the server test device 20 is the storage module 21 and the management module 22 described above. Figure 3 It is exemplified that the storage module 21 may include a database 211. For example, the database can use MySql (a relational database management system), etc., which is not limited here.
[0040] The server cluster 30 may include multiple server cabinets. Figure 3 It is exemplified that the server cabinets of the server cluster 30 include cabinet a1 - cabinet a4, cabinet b1 - cabinet b4, and cabinet c1 - cabinet c4.
[0041] For the description of the features in the embodiments corresponding to the server test device, reference can be made to the relevant descriptions in the embodiments corresponding to the server test method, which will not be elaborated here one by one. As follows, the embodiments of the present application provide a server test method. The working principle of the server test method will be described in detail below in combination with the execution flow of the server test method.
[0042] Please refer to Figure 4 , Figure 4 which is a schematic flowchart of an embodiment of the server test method of the present application.
[0043] S101: Obtain the configuration information of the servers to be tested in the current test cluster.
[0044] In one embodiment, the current test cluster represents a server cluster that executes the current test task, and the current test cluster may include multiple servers to be tested.
[0045] A server to be tested represents a server that executes specific test cases of a test task. A server is a specific IT (Information Technology) device that provides computing power and runs software applications in a network environment. A server can provide computing or application services for other client machines (such as terminal devices like personal computers and smartphones) in the network. Generally, a server has the capabilities to undertake response service requests, undertake services, and ensure services.
[0046] Configuration information is used to identify the configuration components included in the server to be tested, etc., so as to select a server whose configured components meet the test environment requirements when scheduling test cases to be tested. The configuration components may include a CPU (Central Processing Unit), a GPU (Graphics Processing Unit), memory, an HBA (Host bus adapter), a heat dissipation component, etc., which are not limited herein.
[0047] That is to say, in this embodiment, it is not necessary to strictly require each server to be tested to be configured with all components, which can reduce the rigid requirements for the configuration components of the server to be tested. During the actual server test process, it is possible to determine whether a test case to be tested can be tested / executed based on the configuration information indicating the configuration components.
[0048] That is to say, in this embodiment, before scheduling a test case to be tested to a server to be tested, the configuration information of the server to be tested, etc., can be obtained to evaluate whether the server to be tested meets the test resource requirements of the test case to be tested. For example, the configuration information can be obtained by connecting to the server to be tested, or it is possible to receive the configuration information of each server to be tested in the current test cluster sent externally.
[0049] S102: Obtain the test duration of the test case to be tested, and select a first test case and a second test case as parallel test cases; wherein, the test duration of the first test case is greater than or equal to the test duration of the second test case, and the first test case and the second test case are compatible with each other.
[0050] In one embodiment, the test duration represents the estimated time length required to complete the test / execution of the test case. The test task of a server usually includes multiple test cases to be tested.
[0051] To make full use of the performance of the server under test and improve the test efficiency, multiple test cases to be tested that are compatible with each other can be selected as parallel test cases. The parallel test cases can include a first test case and a second test case. The first test case belongs to the test cases to be tested, and the second test case also belongs to the test cases to be tested. Moreover, the test duration of the first test case is greater than or equal to the test duration of the second test case.
[0052] It should be noted that when testing the server under test, even if the number of the second test cases can be zero. In other words, even if the test cases to be tested can be tested in parallel with other test cases to be tested, it is also possible to independently test only one test case to be tested, depending on the resource usage information of the configured components in the server under test, or depending on the number of test cases to be tested remaining to be tested, or depending on the test requirements, etc., which are not strictly limited here.
[0053] S103: Schedule the parallel test cases to the current server and make the current server execute the parallel test cases in parallel; wherein, the current server is the server under test whose configuration information meets the test resource requirements of the parallel test cases.
[0054] In one embodiment, the current server is the server under test currently used to execute the parallel test cases, that is, the configuration information of the current server meets the resource requirements of the parallel test cases.
[0055] The parallel test cases can be scheduled to the current server in parallel, or the test cases to be tested as parallel test cases can be scheduled to the current server in a sequential order, which is not limited here. In this way, the current server can perform parallel testing on the parallel test cases.
[0056] Thus, since the configuration information of the servers under test in the current test cluster and the test resource requirements of the test cases to be tested are stored in advance, the servers under test suitable for executing them can be selected based on the test resource requirements of the test cases to be tested. At the same time, the test duration of the test cases to be tested is obtained, and multiple test cases to be tested that are compatible with each other are selected as parallel test cases based on the obtained test duration, and the parallel test cases are scheduled to a server under test that meets the test requirements of the parallel test cases for parallel testing of the parallel test cases. Therefore, the technical problem of unsatisfactory server test efficiency can be solved, and the technical effects of improving the server test efficiency and reliability can be achieved.
[0057] Further, when obtaining the first test case and the second test case that are compatible with each other, the test type of the test case to be tested that is currently selected as the first test case and to be scheduled to the server under test can be obtained, so as to select a test case to be tested with a test type that is pre-configured to be compatible with this test type as the second test case, and the test duration of the test case to be tested selected as the second test case is less than or equal to the test duration of the first test case.
[0058] For example, when the test type of the first test case is CPU test, the second test case is selected from the test cases to be tested with a test type of non-memory test. Similarly, when the test type of the first test case is memory test, the second test case is selected from the test cases to be tested with a test type of non-CPU test.
[0059] Please refer to Figure 5 , Figure 5 which is a schematic flowchart of another embodiment of the server test method of this application.
[0060] S201: Obtain the configuration information of the server under test in the current test cluster.
[0061] S202: Obtain the test resource requirements of the test case to be tested.
[0062] S203: Store the configuration information and the test resource requirements in the storage module.
[0063] In this embodiment, as Figure 6 exemplarily shown in Figure 6 which is a schematic structural diagram of an embodiment of the storage module of this application. There are a large number of servers under test in each server cabinet. Test engineers need to manually add the server IP to the area of the server under test and include it in the specified project. After the remote system obtains the IP (Internet Protocol) user names and passwords of the OS (operating system) and BMC (baseboard management controller), it can check the specific configuration of the server through asset information, fru (field replaceable unit) information, etc., and establish an association relationship between the current server and the existing component library. Figure 6 In
[0064] S204: Obtain the test duration of the test case to be tested.
[0065] S205: Obtain the test type of the test case to be tested.
[0066] S206: Evaluate whether the test type of the test case to be tested requires independent testing.
[0067] In this embodiment, in response to evaluating that the test type of the test case to be tested requires independent testing, step S207 is executed; in response to evaluating that the test type of the test case to be tested does not require independent testing, step S209 is executed.
[0068] Evaluate whether the test type of the test case to be tested requires independent testing. For example, when the test type is a mixed load pressure model test, it is determined that the test case to be tested is not suitable for parallel testing, so it is determined that it requires independent testing.
[0069] S207: Determine that the test case to be tested requires serial testing.
[0070] S208: Assign a preset identifier to the server under test that executes the serial test case.
[0071] In this embodiment, in response to scheduling the test case to be tested to the server under test, a preset identifier is assigned to the server under test that executes the serial test case. So that the server under test that executes the serial test case focuses on the serial test case, which is beneficial to ensuring the execution reliability of the serial test case.
[0072] Among them, the preset identifier is used to identify that no new test cases to be tested are scheduled to the server under test carrying it.
[0073] Such as Figure 7 as exemplified in Figure 7 is a schematic structural diagram of an embodiment of the current test cluster of the present application. Figure 7 exemplifies the current test cluster including y servers under test, where the server under test s3 carries the preset identifier.
[0074] Furthermore, the preset identifier can also be assigned by identifying whether the server under test can continue to participate in the test task.
[0075] For example, for all servers under test, each time the remaining CPU resources of the server under test are checked, initially 100%, and deductions are made according to the parallel test case / serial test case annotation, and sorting is performed according to the remaining CPU resources. If a use case believes that it cannot be parallel, a preset identifier is assigned, for example, it can be marked as -1. When this situation occurs, before the end of the test of this use case, the remaining cpu resources of the server under test are all marked as -1 and no longer participate in the parallel test sorting of the server.
[0076] S209: Determine that the test case to be tested can be tested in parallel.
[0077] S210: Select the first test case based on the test duration.
[0078] Select the test case to be tested whose test duration is higher than that of other test cases to be tested with the target quantity as the first test case.
[0079] S211: Schedule the first test case to the test main thread of the current server.
[0080] S212: Obtain the resource scores of other test cases to be tested that match their test resource requirements.
[0081] S213: Select a second test case from other test cases to be tested based on the resource scores.
[0082] In this embodiment, one or more other test cases to be tested can be selected based on the resource scores as the second test case.
[0083] That is to say, in this embodiment, the first test case can be selected by the test duration, and the second test case for parallel testing with the first test case can be selected by the resource scores, so as to utilize different selection strategies for the test cases to be tested executed as different test threads. Moreover, in this embodiment, the test cases to be tested with longer test duration and higher resource consumption are preferentially executed, in order to comprehensively improve the test efficiency of the server.
[0084] Optionally, the configuration information may include resource usage information.
[0085] Specifically, the test resource requirements of the first test case can be superimposed on the current information. Wherein, the current information represents the resource usage information of the current server.
[0086] Resource score according to the preset order, evaluate whether the current information supports testing other test cases to be tested, in response to the current information supporting testing other test cases to be tested, select other test cases to be tested as the new second test case, and superimpose the test resource requirements of the new second test case on the current information; until all other test cases to be tested are traversed.
[0087] That is to say, in this embodiment, when implementing the allocation of test cases to be tested, the resource usage information of the current server can be updated, which is beneficial to improving the timeliness of the configuration information. Furthermore, compared with traditional manual inspection or static resource pool and other methods, this embodiment is beneficial to improving the efficiency of obtaining the resource usage information of the test server to be tested, and thus is beneficial to quickly identifying and scheduling the test cases to be tested.
[0088] Furthermore, when selecting the test server to be the current server, the resource usage information of the test server to be tested can be obtained to quickly identify the test server to be tested with a current load rate lower than the dynamic threshold, and it can be used as the current server. For example, the dynamic threshold can be that the CPU utilization rate is lower than 15% and the memory occupancy rate is lower than 20%, etc., and the dynamic threshold can be adjusted according to the actual situation, which will not be elaborated here.
[0089] Furthermore, when scheduling the test case to be tested to the current server, it is also possible to determine whether the current server meets the resource guarantee requirements of the test task. Among them, the resource guarantee requirements of the test task refer to the load conditions reached by the configuration components at least required for the test and execution of the test case to be tested. For example, the resource guarantee requirements of the test task may require that the CPU utilization rate reaches at least 75%. At this time, if the actual load condition of the current server is lower than the resource guarantee requirements of the test task, the current server is pressurized. The pressurization strategy is to superimpose the resource guarantee requirements of the test task on the current server, which is conducive to improving the configuration efficiency of the current server. For example, if the CPU utilization rate of the current server is 10%, then the CPU utilization rate is pressurized by 75%, and the utilization rate of the current server after pressurization is 85%.
[0090] For example, the resource guarantee requirements of the test task may include parameters such as the expected CPU core-hour consumption and the peak memory occupancy, which will not be elaborated here.
[0091] Optionally, it is possible to obtain the configuration components of other test case requirements to be tested, fit the preset scores and preset weights of the configuration components as the resource score. The calculation formula can be as follows:
[0092]
[0093] Among them, S represents the resource score, i represents the i-th configuration component, r i represents the preset score; w represents the preset weight of the configuration component.
[0094] For example, the preset weights of configuration components such as CPU, memory, and network card are 2, and the preset weights of the remaining configuration components are 1. That is to say, the preset weights of configuration components such as CPU, memory, and network card can be higher than those of other configuration components. The specific planning method can be planned in combination with the test type to identify the preset association level between the configuration component and the test type. The preset association level can include a first-level association and a second-level association. The preset weight of the first-level association configuration component is higher than that of the second-level configuration component to improve the fitting correlation between the resource score and the resource requirements and the test type.
[0095] S214: Schedule the second test case to the test parallel thread of the current server.
[0096] In one embodiment, a second test case with a relatively shorter or matching test duration is scheduled to the test parallel threads of the current server to execute the test in the test parallel threads. Thus, since when the first test case executed by the test main thread completes the test, the second test case in the test parallel threads can also complete the test or be about to complete the test, in this embodiment, it is allowed that the second test case has not completed when the first test case completes the test. There is an interval time for the test main thread to execute the next first test case, so it is acceptable in this embodiment that the second test case has not completed, and it can still improve the test efficiency.
[0097] S215: Obtain the first quantity and the second quantity.
[0098] In one embodiment, the first quantity is the number of test cases to be tested waiting for testing, and the second quantity is the number of servers to be tested.
[0099] S216: Compare whether the first quantity is less than the second quantity.
[0100] In one embodiment, in response to the first quantity being less than the second quantity, step S217 is executed. In response to the first quantity not being less than the second quantity, the scheduling process of the current test case to be tested ends, and a new one can be selected from the waiting test cases to be tested for test execution (not illustrated in the figure).
[0101] S217: Release the third quantity of servers to be tested.
[0102] In one embodiment, the third quantity is the difference between the first quantity and the second quantity.
[0103] In response to the first quantity being less than the second quantity, select the difference quantity of servers to be tested and release them from the current test cluster.
[0104] Furthermore, when the release of the third quantity of servers to be tested is completed, a new one can be selected from the waiting test cases to be tested for test execution (not illustrated in the figure).
[0105] Thus, in this embodiment, the resources of the servers to be tested in the server cluster can be saved, the timeliness of releasing the servers to be tested can be improved, enabling them to quickly participate in other test tasks, and further being beneficial to improving the macroscopic efficiency of the server test system.
[0106] Thus, in this embodiment, all the servers to be tested and the test cases to be tested can be checked and completed within a time complexity of O(yz). Where y is the number of servers to be tested and z is the traversal duration of the test cases to be tested. And the order is that the use cases that occupy the most resources are executed first, and the use cases that occupy less are executed later.
[0107] The dynamic optimization ability of resources in this application breaks through the limitations of traditional static allocation. It automatically coordinates computing resources based on real-time load perception, which can effectively reduce the risks of extreme states of resource idleness and overload, and is conducive to keeping the server under test in a relatively high-performance balance range. At the same time, the test process in this application has an intelligent leap. Through demand prediction and task priority determination (such as based on whether independent testing is required, test duration, resource scores, etc.), it realizes the precise matching of test tasks and resource supply, significantly reducing manual intervention and waiting time. In addition, this application can also improve environmental compatibility, which is conducive to expanding the adaptation of heterogeneous hardware and multi-cloud platforms. This application can also provide a unified resource scheduling interface for complex technology stacks. Thus, while improving the test execution efficiency, the overall solution can also build a sustainable optimization operation and maintenance foundation for the IT system through refined resource management.
[0108] Furthermore, aiming at the efficiency bottleneck of dynamic scheduling of physical server resources in the automated test scenario, this application can solve two core problems: First, how to quickly identify physical servers with a current load rate lower than the dynamic threshold (such as CPU utilization < 15%, memory occupancy < 20%) in a multi-node distributed environment, avoiding response delays caused by traditional manual inspections or static resource pool partitioning. Second, an accurate remaining resource prediction model can be established by collecting indicators such as the CPU computing power, memory capacity, storage, and network bandwidth of the server in real time. Thus, in combination with the resource requirement template of the test case (including parameters such as expected CPU core-hour consumption and memory peak occupancy), it can dynamically determine whether the target server meets the minimum resource guarantee requirements of the test task. For nodes with insufficient resources, they are included in the serial queue through the task priority algorithm; for nodes that meet the requirements, second-level resource reservation and automatic test environment deployment are realized, thus breaking through the traditional static scheduling mode based on fixed resource quotas, effectively improving the test task execution efficiency and reducing the server resource idleness rate.
[0109] Therefore, the present application can overcome the problem in the related art that concurrent testing is not considered. For example, when there is sufficient remaining performance in the CPU and memory, the hard disk pressure and network card pressure can be superimposed and tested in parallel, and some information checking work can also be done. And when the overall server pressure is large enough, many automated tests of the power supply can be carried out synchronously, such as power redundancy mode switching, current sharing test, etc. In addition, the related art may not consider the situation where the multi-server environment is inconsistent. For example, some servers may lack some hardware, such as HBA cards, some hard disks, etc., but some other tests can be carried out. For example, the lack of hard disks does not affect the CPU pressure test, etc. This solution requires that the server configurations be almost the same. Also, as described in the previous text, the configuration requirements for the whole cabinet server are more, and it occupies more servers. If concurrent testing cannot be carried out, the waste of resources will be more serious. In the present application, by obtaining the configuration information, problems such as server resource occupation and compatibility with each other can be considered. For example, the performance tests of the server CPU and memory cannot be carried out simultaneously, otherwise it will cause the two tests to preempt resources and the correct server values cannot be obtained. This technical solution is applicable to tests with low resource occupation such as information checking.
[0110] In the present application, all the servers to be tested can be specifically entered into the server testing device, and the information includes IP, username, password, etc. Check all the components included in the servers to be tested and associate them with the component library of the server testing device. Divide the test cases to be executed according to the execution time length. For all the servers to be tested, give priority to executing the long test cases that have not been executed at all, and perform at least one automated test on all the servers to be tested (if there are no test cases to be executed, directly end. For example, there are 5 test cases to be executed but 7 servers). The remaining CPU resources of all the servers to be tested can be sorted, and first check whether the remaining resources of the servers with high remaining CPU resources can meet the resource requirements in the remaining test cases to be executed. If it can be met, perform parallel testing and continue to check the subsequent test cases to be executed.
[0111] It is also possible to separately pull all the test cases to be executed to establish a new project database. At the same time, the information of these test cases includes the total execution time of the test case, required components, etc. If this test case cannot be mixed with any other test, the CPU occupancy rate is -1, indicating that this test case will occupy all the resources of the entire server and no concurrent testing will be carried out anymore (commonly seen in the mixed load pressure model test, where any component applying pressure will affect the test result). The database information format will be shown together in the next step.
[0112] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware. Of course, it does not exclude that in many cases the former is a better implementation method.
[0113] Please refer to Figure 8 , Figure 8 , which is a schematic structural diagram of an embodiment of the electronic device of the present application.
[0114] In one embodiment, the electronic device may include a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any of the above-mentioned embodiments of the server testing method.
[0115] For example, the electronic device may be a server or a mobile terminal. Figure 8 The server architecture when the electronic device is a server is exemplified in
[0116] An embodiment of the present application also provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps in any of the above-mentioned embodiments of the server testing method when running.
[0117] In an exemplary embodiment, the above-mentioned computer-readable storage medium may include, but is not limited to: various media such as USB flash drives, read-only memories (ROM for short), random access memories (RAM for short), mobile hard disks, magnetic disks, or optical discs that can store computer programs.
[0118] An embodiment of the present application also provides a computer program product. The above-mentioned computer program product includes a computer program, and the steps in any of the above-mentioned embodiments of the server testing method are implemented when the computer program is executed by a processor.
[0119] An embodiment of the present application also provides another computer program product, including a non-volatile computer-readable storage medium. The non-volatile computer-readable storage medium stores a computer program, and the steps in any of the above-mentioned embodiments of the server testing method are implemented when the computer program is executed by a processor.
[0120] Those skilled in the art can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods for each specific application to implement the described functions, but such implementation should not be considered to exceed the scope of the present application.
[0121] The above has introduced in detail a server testing method, a server testing device, an electronic device, and a computer-readable storage medium provided by the present application. Specific examples are used in this article to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application. It should be noted that for those of ordinary skill in the art in this technical field, without departing from the principle of the present application, several improvements and modifications can still be made to the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.
Claims
1. A server testing method, characterized in that, The server testing method includes: Obtaining the configuration information of the server to be tested in the current test cluster; Obtaining the test duration of the test case to be tested, and selecting the first test case and the second test case as parallel test cases; wherein, the test duration of the first test case is greater than or equal to the test duration of the second test case, and the first test case and the second test case are compatible with each other; Scheduling the parallel test cases to the current server, and causing the current server to execute the parallel test cases in parallel; wherein, the current server is the server to be tested whose configuration information meets the test resource requirements of the parallel test cases.
2. The server testing method according to claim 1, wherein The selecting the first test case and the second test case as parallel test cases includes: Selecting the test case to be tested whose test duration is higher than that of other test cases to be tested by a target quantity as the first test case; Obtaining the resource score matching the other test cases to be tested and their test resource requirements; Selecting one or more of the other test cases to be tested as the second test case based on the resource score.
3. The server testing method according to claim 2, wherein The configuration information includes resource usage information; the selecting one or more second test cases based on the resource score includes: Adding the test resource requirements of the first test case to the current information; wherein, the current information represents the resource usage information of the current server; Evaluating whether the current information supports testing the other test cases to be tested according to the preset order of the resource scores, and in response to the current information supporting testing the other test cases to be tested, selecting the other test cases to be tested as the new second test case, and adding the test resource requirements of the new second test case to the current information; until all the other test cases to be tested are traversed.
4. The server testing method according to claim 2, characterized in that, The obtaining the resource score matching the other test cases to be tested and their test resource requirements includes: Obtaining the configuration components required by the other test cases to be tested; Fitting the preset scores and preset weights of the configuration components as the resource score.
5. The server testing method according to claim 1 or 2, characterized in that The scheduling the parallel test cases to the current server includes: Scheduling the first test case to the test main thread of the current server; Scheduling the second test case to the test parallel thread of the current server.
6. The server testing method according to claim 1, wherein After obtaining the test duration of the test case to be tested, it includes: Obtaining the test type of the test case to be tested; Evaluating whether the test type requires independent testing; In response to the requirement for independent testing, taking the test case to be tested as a serial test case; Assigning a preset identifier to the server to be tested for executing the serial test case; wherein, the preset identifier is used to identify that no new test cases to be tested are scheduled to the server to be tested carrying it.
7. The server testing method according to claim 1, characterized in that After obtaining the configuration information of the server to be tested in the current test cluster, it further includes: Obtaining a first quantity and a second quantity; wherein, the first quantity is the number of test cases to be tested waiting for testing, and the second quantity is the number of the servers to be tested; In response to the first quantity being less than the second quantity, selecting the difference quantity of the servers to be tested to be released from the current test cluster.
8. A server testing device, characterized in that, The server testing device includes: A storage module for storing the configuration information of the server to be tested and the test resource requirements of the test cases to be tested; A management module, connected to the storage module, for connecting to the current test cluster to implement the server test method according to any one of claims 1 to 7.
9. An electronic device, characterized in that, Comprising: A memory for storing computer programs; A processor for implementing the steps of the server test method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium, wherein the computer program implements the steps of the server test method according to any one of claims 1 to 7 when executed by the processor.
Citation Information
Cited By
Test method and electronic equipment
CN120892276A