A server test method, device, equipment and readable storage medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-30
- Publication Date
- 2026-08-11
AI Technical Summary
可见当前测试方案对人工依赖性大,测试过程需要专人看管,测试效率较低
[0042]通过以上方案可知,本申请提供了一种服务器测试方法,应用于控制端,包括:若获取到运行指令,则调用测试工具读取所述控制端中预置的各个测试用例、每个测试用例的测试启动时间和测试次数;若到达任一测试用例的测试启动时间,则按照该测试用例的测试次数在被测服务器中循环执行该测试用例,在该测试用例的循环执行次数达到所述测试次数时,基于该测试用例的各次执行结果确定该测试用例的测试结果;若所有测试用例均执行完成,则按照预设格式记录所有测试用例的测试结果。
Smart Images

Figure CN116048942B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a server testing method, apparatus, device, and readable storage medium. Background Technology
[0002] Currently, when testing server performance, test commands need to be manually entered to execute each test item and corresponding test case, and test results also need to be manually queried and recorded. It is evident that the current testing solution is highly dependent on manual intervention, requires dedicated personnel to monitor the testing process, and results in low testing efficiency.
[0003] Therefore, how to reduce the reliance on manual labor in server testing and improve the efficiency of server testing is a problem that needs to be solved by those skilled in the art. Summary of the Invention
[0004] In view of this, the purpose of this application is to provide a server testing method, apparatus, device, and readable storage medium to reduce the reliance on manual labor in server testing and improve server testing efficiency. The specific solution is as follows:
[0005] Firstly, this application provides a server testing method applied to a control terminal, including:
[0006] If the execution command is obtained, the test tool is invoked to read the preset test cases in the control terminal, the test start time of each test case, and the number of test times;
[0007] If the test start time of any test case is reached, the test case is executed repeatedly on the server under test according to the number of times the test case is tested. When the number of times the test case is executed repeatedly reaches the number of times the test case is tested, the test result of the test case is determined based on the results of each execution of the test case.
[0008] If all test cases have been executed, the test results of all test cases will be recorded in a preset format.
[0009] Optionally, when executing any test case on the server under test, a log file corresponding to the current execution of the test case is created in a preset directory, and the execution log of the current test case is recorded in the log file.
[0010] Optionally, determining the test result of the test case based on the execution results of each test case includes:
[0011] Read the execution results of each test case from the preset directory; each execution result includes at least one test metric value;
[0012] Calculate the average value of the same test metric in each execution result;
[0013] The average value of the at least one test metric is recorded as the test result of the current test case.
[0014] Optionally, the test metrics include: bandwidth, latency, and IOPS.
[0015] Optionally, reading the execution results of each test case from the preset directory includes:
[0016] Traverse each log file in the preset directory to obtain the execution results of each test case.
[0017] Optionally, the step of calling the testing tool to read the preset test cases in the control terminal, the test start time of each test case, and the number of test attempts, includes:
[0018] A test command is sent to the controlled terminal to invoke the test tool in the controlled terminal to read each pre-set test case, the test start time of each test case, and the number of test attempts in the control terminal.
[0019] Optionally, recording the test results of all test cases according to a preset format includes:
[0020] Record the test results of each test case in a table according to the order of test start time.
[0021] Secondly, this application provides a server testing device, applied to a control terminal, comprising:
[0022] The calling module is used to call the test tool to read the preset test cases, test start time and test count of each test case in the control terminal if a run instruction is obtained;
[0023] The testing module is used to execute the test case repeatedly on the server under test according to the number of times the test case is tested when the test start time of any test case is reached. When the number of times the test case is executed repeatedly reaches the number of times the test case is tested, the test result of the test case is determined based on the execution results of each test case.
[0024] The recording module is used to record the test results of all test cases in a preset format if all test cases have been executed.
[0025] Optionally, it also includes:
[0026] The logging module is used to create a log file corresponding to the current execution of any test case in a preset directory when executing any test case on the server under test, and to record the execution log of the current test case to the log file.
[0027] Optionally, the testing module is specifically used for:
[0028] Read the execution results of each test case from the preset directory; each execution result includes at least one test metric value;
[0029] Calculate the average value of the same test metric in each execution result;
[0030] The average value of the at least one test metric is recorded as the test result of the current test case.
[0031] Optionally, the test metrics include: bandwidth, latency, and IOPS.
[0032] Optionally, the testing module is specifically used for:
[0033] Traverse each log file in the preset directory to obtain the execution results of each test case.
[0034] Optionally, the calling module is specifically used for:
[0035] A test command is sent to the controlled terminal to invoke the test tool in the controlled terminal to read each pre-set test case, the test start time of each test case, and the number of test attempts in the control terminal.
[0036] Optionally, the recording module is specifically used for:
[0037] Record the test results of each test case in a table according to the order of test start time.
[0038] Thirdly, this application provides an electronic device, comprising:
[0039] Memory, used to store computer programs;
[0040] A processor for executing the computer program to implement the aforementioned disclosed server testing method.
[0041] Fourthly, this application provides a readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the aforementioned disclosed server testing method.
[0042] As can be seen from the above scheme, this application provides a server testing method applied to the control end, including: if a run instruction is obtained, a testing tool is invoked to read each pre-set test case, the test start time and the number of tests for each test case in the control end; if the test start time of any test case is reached, the test case is executed cyclically in the server under test according to the number of tests for that test case; when the number of cyclic executions of the test case reaches the number of tests, the test result of the test case is determined based on the execution results of each test case; if all test cases are executed, the test results of all test cases are recorded according to a preset format.
[0043] As can be seen, after receiving the execution command, the control terminal provided in this application can call the testing tool to read the preset test cases, the test start time and the number of test attempts for each test case. When the test start time of any test case is reached, the test case is executed repeatedly on the server under test according to the number of test attempts for that test case. When the number of execution attempts for a test case is reached, the test result of the test case is determined based on the execution results of each test case. If all test cases are executed, the test results of all test cases are recorded according to a preset format. Therefore, only manual triggering of the control terminal is required, and the subsequent test process and test result recording can be completed with the help of the control terminal without manual intervention. Thus, this solution can reduce the dependence of the server testing process on manual intervention and improve the efficiency of server testing.
[0044] Correspondingly, the server testing apparatus, device, and readable storage medium provided in this application also have the above-mentioned technical effects. Attached Figure Description
[0045] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0046] Figure 1 This is a flowchart of a server testing method disclosed in this application;
[0047] Figure 2 This is a schematic diagram of a test result disclosed in this application;
[0048] Figure 3 This is a code illustration of a test requirement modification disclosed in this application;
[0049] Figure 4 This is a flowchart of another server testing method disclosed in this application;
[0050] Figure 5 This is a schematic diagram of the code for calculating a test result as disclosed in this application;
[0051] Figure 6 This is a schematic diagram of a server testing device disclosed in this application;
[0052] Figure 7 This is a schematic diagram of an electronic device disclosed in this application. Detailed Implementation
[0053] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0054] Currently, server performance testing requires manually entering test commands to execute each test item and corresponding test case, and test results also need to be manually queried and recorded. It is evident that the current testing approach is highly dependent on manual intervention, requires dedicated personnel to oversee the testing process, and suffers from low testing efficiency. Therefore, this application provides a server testing solution that reduces the reliance on manual intervention in server testing and improves server testing efficiency.
[0055] See Figure 1 As shown in the figure, this application discloses a server testing method applied to a control terminal, including:
[0056] S101. If the execution command is obtained, the test tool is called to read the preset test cases in the control terminal, the test start time of each test case, and the number of test times.
[0057] In this embodiment, the control terminal can be a program script, which can be installed on any computer device, including but not limited to smartphones, tablets, laptops, desktop computers, servers, etc. The testing tool can be installed on the same computer device as the control terminal, or on other computer devices. The program script serving as the control terminal can be implemented using any programming language.
[0058] As described in step S101, the control terminal pre-configures various test cases, the test start time for each test case, and the number of tests. Each test case specifies: IO operation type, IO size per operation, number of IOs sent to the server under test per operation, and the number of concurrent threads on the server under test. IO operation types include, for example, random read, random write, sequential read, and sequential write. The server under test executes the corresponding test case; that is, the server under test performs IO processing according to the settings of the test case. During the execution of the corresponding test case, the bandwidth, latency, and IOPS of the server under test are monitored. Based on these metrics, the performance of the server under test can be determined.
[0059] S102. If the test start time of any test case is reached, the test case is executed repeatedly on the server under test according to the number of times the test case is executed. When the number of times the test case is executed repeatedly reaches the number of times the test case is executed, the test result of the test case is determined based on the execution results of each test case.
[0060] In one specific implementation, when any test case is executed on the server under test, a log file corresponding to that execution of the current test case is created in a preset directory, and the execution log of the current test case is recorded in the log file. The log file may record: execution start time, IO operation type, IO size, thread ID used to handle each IO, execution time of each thread, bandwidth, latency, IOPS, execution end time, etc. The specific information recorded can be flexibly configured on the control terminal.
[0061] In one specific implementation, determining the test result of a test case based on the execution results of each execution of the test case includes: reading the execution results of the current test case from a preset directory; each execution result includes at least one test metric value; calculating the average value of the same test metric value in each execution result; and recording the average value of at least one test metric value as the test result of the current test case. In one specific implementation, the test metric values include: bandwidth, latency, and IOPS. In one specific implementation, reading the execution results of the current test case from the preset directory includes: traversing each log file in the preset directory to obtain the execution results of the current test case.
[0062] In one example, a test case is tested 5 times, so 5 execution results can be obtained for this test case. Assuming that each execution result includes three metrics: bandwidth, latency, and IOPS, then the test result of this test case includes the average of these three metrics.
[0063] S103. If all test cases have been executed, record the test results of all test cases in a preset format.
[0064] In one specific implementation, the test results of all test cases are recorded according to a preset format, including: recording the test results of each test case in a table according to the order of test start time. For example... Figure 2 As shown, Figure 2 The test results for 8 test cases are recorded. Test case 1 tests the bandwidth for read operations, and the bandwidth value obtained is 1634.12; Test case 2 tests the bandwidth for write operations, and the bandwidth value obtained is 438.06; Test case 3 tests the IOPS for random read operations, and the IOPS value obtained is 23213.36; Test case 4 tests the IOPS for random write operations, and the IOPS value obtained is 6266.93; Test case 5 tests the IOPS for read operations, and the IOPS value obtained is 27074.99; Test case 6 tests the IOPS for write operations, and the IOPS value obtained is 3043.02; Test case 7 tests the latency for random read operations, and the latency value obtained is 0.06; Test case 8 tests the latency for random write operations, and the latency value obtained is 0.17.
[0065] This embodiment is also applicable to multi-terminal testing scenarios, setting up a master control device and multiple controlled devices. The master control device is equipped with testing tools and a control terminal, while each controlled device is equipped with a controlled terminal and a testing tool. The control terminal on the master control device can then call the testing tool on the controlled device to perform server testing. This allows one master control device and multiple controlled devices to simultaneously issue test I / O to the same server under test, enabling the same server to be tested by multiple devices. Each device can obtain corresponding test results, and after the test is completed, the master control device collects all test results. The controlled terminal can be a program script. In one specific implementation, calling the testing tool to read the preset test cases, test start time, and test count of each test case in the control terminal includes: sending test commands to the controlled terminal to call the testing tool on the controlled terminal to read the preset test cases, test start time, and test count of each test case in the control terminal. The test I / O generally simulates the actual business processes that need to run on the server under test.
[0066] Of course, this embodiment is also applicable to single-end testing scenarios, that is: setting up a master control device, which is equipped with a control terminal and testing tools, and the master control device sends test I / O to the server under test.
[0067] As can be seen, after receiving the execution command, the control terminal provided in this embodiment can call the testing tool to read the preset test cases, the test start time and the number of tests for each test case. When the test start time of any test case is reached, the test case is executed repeatedly on the server under test according to the number of tests for that test case. When the number of times the test case is executed repeatedly is reached, the test result of the test case is determined based on the execution results of each test case. If all test cases are completed, the test results of all test cases are recorded according to a preset format. Therefore, only manual triggering of the control terminal is required, and the subsequent test process and test result recording can be completed with the help of the control terminal without manual intervention. Thus, this solution can reduce the dependence of the server testing process on manual intervention and improve the efficiency of server testing.
[0068] The following embodiment uses a single-ended test scenario and the fio testing tool as an example to introduce the solution. A Python script used as the control terminal is installed on a server, and the fio testing tool is also installed on the server. This server is used to issue I / O to the device under test. The server may specifically include: at least one processor, at least one memory, a power supply, a communication interface, input / output interfaces, and a communication bus. The power supply provides operating voltage to the various hardware devices on the server; the communication interface can create a data transmission channel between the server and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, without specific limitations; the input / output interface is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, without specific limitations. The memory, as the carrier of resource storage, can be a read-only memory, random access memory, disk, or optical disk, etc. The resources stored on it include the operating system, computer programs, and data, and the storage method can be temporary storage or permanent storage. The operating system is used to manage and control the various hardware devices and computer programs on the server to realize the processor's operation and processing of data in the memory, and it can be Windows Server, Netware, Unix, Linux, etc.
[0069] Specifically, the Python script used as the control terminal contains multiple test items, specifying the number of times each test item can be executed and its execution time. Each test item constitutes a test case. Furthermore, the script can collect test results and generate JSON-formatted logs. The test requirements within the script can be flexibly added to or modified, such as... Figure 3As shown, modifying the corresponding lines of code in the Python script allows for changes to the testing requirements. Each test case specifies: IO operation type, IO size per operation, number of IOs sent to the server under test per operation, and number of concurrent threads on the server under test. IO operation types include, for example, random read, random write, sequential read, and sequential write. The server under test executes the corresponding test case; that is, the server performs IO processing according to the test case settings. During the execution of the test case, metrics such as bandwidth, latency, and IOPS are monitored. Based on these metrics, the performance of the server under test can be assessed.
[0070] Please see Figure 4 The script has the following functions: It automatically performs server tests using the fio tool according to testing requirements and saves test logs; it iterates through the test logs to obtain test performance values; and it calculates the average performance value for each test and saves it to a table file. The test logs can record: execution start time, IO operation type, IO size, thread ID used to handle each IO, execution time of each thread, bandwidth, latency, IOPS, and execution end time. The specific information recorded can be flexibly configured in the Python script.
[0071] For each test item, the `fio` command is issued cyclically according to its execution count. The results of each execution are saved in JSON format to a specified directory. A Python script can then parse and analyze the JSON logs to obtain performance values such as IOPS, bandwidth, and latency. The average performance metrics of each test item across multiple executions are calculated and saved to a table. After the test execution is complete, the results of all test cases stored in the Excel table can be viewed directly. The code implementation for calculating the average is as follows: Figure 5 As shown.
[0072] As can be seen, this embodiment enables the fio tool to automatically test server performance and automatically perform performance result statistics, reducing the need for manual operation. Therefore, it can make full use of nighttime or the idle time of the device under test to conduct performance testing, which can effectively improve the overall testing efficiency and test progress.
[0073] For multi-device testing scenarios, a master control device and multiple controlled devices are configured. The control terminal on the master control device can invoke testing tools on the controlled devices to perform server testing. This allows one master control device and multiple controlled devices to simultaneously issue test I / O to the same server under test, enabling the same server to be tested from multiple ends. Each device can obtain corresponding test results, and after the test is completed, the master control device collects all test results. The test I / O typically simulates the actual business logic that needs to run on the server under test.
[0074] The following describes a server testing apparatus provided in an embodiment of this application. The server testing apparatus described below and the server testing method described above can be referred to each other.
[0075] See Figure 6 As shown in the figure, this application discloses a server testing device applied to a control terminal, comprising:
[0076] Module 601 is called to call the test tool to read the preset test cases, test start time and test count of each test case in the control terminal if the run instruction is obtained.
[0077] The test module 602 is used to execute the test case repeatedly on the server under test according to the number of times the test case is tested if the test start time of any test case is reached. When the number of times the test case is executed repeatedly is reached, the test result of the test case is determined based on the execution results of each test case.
[0078] The recording module 603 is used to record the test results of all test cases in a preset format if all test cases have been executed.
[0079] In one specific implementation, it further includes:
[0080] The logging module is used to create a log file corresponding to the current execution of any test case in a preset directory when executing any test case on the server under test, and to record the execution log of the current test case to the log file.
[0081] In one specific implementation, the testing module is specifically used for:
[0082] Read the execution results of the current test case from the preset directory; each execution result includes at least one test metric value;
[0083] Calculate the average value of the same test metric in each execution result;
[0084] Record the average value of at least one test metric as the test result of the current test case.
[0085] In one specific implementation, the test metrics include: bandwidth, latency, and IOPS.
[0086] In one specific implementation, the testing module is specifically used for:
[0087] Iterate through the log files in the preset directory to obtain the execution results of each test case.
[0088] In one specific implementation, the calling module is specifically used for:
[0089] Send test commands to the controlled end to invoke the test tools on the controlled end to read the preset test cases, test start time and number of tests for each test case in the control end.
[0090] In one specific implementation, the recording module is specifically used for:
[0091] Record the test results of each test case in a table according to the order of test start time.
[0092] For more detailed information on the working process of each module and unit in this embodiment, please refer to the relevant content disclosed in the foregoing embodiments, which will not be repeated here.
[0093] As can be seen, this embodiment provides a server testing device. After receiving a run command, the control terminal of this device can call a testing tool to read preset test cases, the test start time of each test case, and the number of test iterations. When the test start time of any test case is reached, the test case is executed repeatedly on the server under test according to the number of test iterations. When the number of execution iterations of a test case reaches the required number of iterations, the test result of the test case is determined based on the execution results of each iteration. If all test cases are completed, the test results of all test cases are recorded according to a preset format. Therefore, only manual triggering of the control terminal is required; subsequent testing processes and test result recording can be completed using the control terminal without manual intervention. Thus, this solution reduces the reliance on manual intervention in the server testing process and improves server testing efficiency.
[0094] The following describes an electronic device provided in an embodiment of this application. The electronic device described below can be referred to in conjunction with the server testing method and apparatus described above.
[0095] See Figure 7 As shown in the figure, an embodiment of this application discloses an electronic device, including:
[0096] Memory 701 is used to store computer programs;
[0097] The processor 702 is configured to execute the computer program to implement the method disclosed in any of the above embodiments.
[0098] In this embodiment, when the processor executes the computer program stored in the memory, it can specifically implement the following steps: If a run instruction is obtained, the test tool is invoked to read each preset test case, the test start time of each test case, and the number of test iterations for each test case from the control terminal. If the test start time of any test case is reached, the test case is executed cyclically on the server under test according to the number of test iterations for that test case. When the number of cyclic executions for a test case reaches the required number of test iterations, the test result of the test case is determined based on the execution results of each iteration. If all test cases are executed completely, the test results of all test cases are recorded according to a preset format.
[0099] In this embodiment, when the processor executes the computer program stored in the memory, it can specifically implement the following steps: when executing any test case in the server under test, create a log file corresponding to the current execution of the test case in a preset directory, and record the execution log of the current test case to the log file.
[0100] In this embodiment, when the processor executes the computer program stored in the memory, it can specifically implement the following steps: read the execution results of each execution of the current test case from a preset directory; each execution result includes at least one test indicator value; calculate the average value of the same test indicator value in each execution result; and record the average value of at least one test indicator value as the test result of the current test case.
[0101] In this embodiment, when the processor executes the computer program stored in the memory, it can specifically implement the following steps: traversing each log file in the preset directory to obtain the execution results of each test case.
[0102] In this embodiment, when the processor executes the computer program stored in the memory, it can specifically implement the following steps: sending test instructions to the controlled end to call the test tool in the controlled end to read each test case preset in the control end, the test start time of each test case, and the number of test times.
[0103] In this embodiment, when the processor executes the computer program stored in the memory, it can specifically implement the following steps: record the test results of each test case in a table according to the test start time order of each test case.
[0104] Furthermore, this application also provides a server as the aforementioned electronic device. Specifically, the server may include: at least one processor, at least one memory, a power supply, a communication interface, an input / output interface, and a communication bus. The memory stores a computer program, which is loaded and executed by the processor to implement the relevant steps in the server testing method disclosed in any of the foregoing embodiments.
[0105] In this embodiment, the power supply is used to provide operating voltage for each hardware device on the server; the communication interface can create a data transmission channel between the server and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0106] In addition, the memory, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored on it include operating system, computer programs and data, etc., and the storage method can be temporary storage or permanent storage.
[0107] The operating system is used to manage and control the various hardware devices and computer programs on the server, enabling the processor to perform operations and processes on the data in the memory. It can be Windows Server, Netware, Unix, Linux, etc. In addition to computer programs capable of performing the server testing methods disclosed in any of the foregoing embodiments, the computer programs may further include computer programs capable of performing other specific tasks. The data may include, in addition to data such as virtual machine data, data such as virtual machine developer information.
[0108] Furthermore, this application also provides a terminal as the aforementioned electronic device. This terminal may specifically include, but is not limited to, a smartphone, tablet computer, laptop computer, or desktop computer.
[0109] Typically, the terminal in this embodiment includes a processor and a memory.
[0110] The processor may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor can be implemented using at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), or PLA (Programmable Logic Array). The processor may also include a main processor and coprocessors. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.
[0111] The memory may include one or more computer-readable storage media, which may be non-transitory. The memory may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In this embodiment, the memory is used to store at least the following computer program, which, after being loaded and executed by the processor, is capable of implementing the relevant steps in the server testing method executed by the terminal side as disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory may also include operating systems and data, and the storage method may be temporary or permanent storage. The operating system may include Windows, Unix, Linux, etc. The data may include, but is not limited to, application update information.
[0112] In some embodiments, the terminal may further include a display screen, an input / output interface, a communication interface, a sensor, a power supply, and a communication bus.
[0113] The following describes a readable storage medium provided in an embodiment of this application. The readable storage medium described below can be referred to in conjunction with the server testing method, apparatus and device described above.
[0114] A readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the server testing method disclosed in the foregoing embodiments.
[0115] In this embodiment, the computer program executed by the processor can specifically implement the following steps: If a run instruction is obtained, the test tool is invoked to read each preset test case, the test start time of each test case, and the number of test iterations for each test case in the control terminal. If the test start time of any test case is reached, the test case is executed cyclically in the server under test according to the number of test iterations for that test case. When the number of cyclic executions for a test case reaches the required number of test iterations, the test result of the test case is determined based on the execution results of each iteration. If all test cases are executed completely, the test results of all test cases are recorded according to a preset format.
[0116] In this embodiment, the computer program executed by the processor can specifically implement the following steps: when executing any test case in the server under test, create a log file corresponding to the current execution of the test case in a preset directory, and record the execution log of the current test case to the log file.
[0117] In this embodiment, the computer program executed by the processor can specifically implement the following steps: read the execution results of each execution of the current test case from a preset directory; each execution result includes at least one test indicator value; calculate the average value of the same test indicator value in each execution result; and record the average value of at least one test indicator value as the test result of the current test case.
[0118] In this embodiment, the computer program executed by the processor can specifically implement the following steps: traversing each log file in the preset directory to obtain the execution results of each test case.
[0119] In this embodiment, the computer program executed by the processor can specifically implement the following steps: sending test instructions to the controlled end to call the test tool in the controlled end to read each test case preset in the control end, the test start time of each test case, and the number of test times.
[0120] In this embodiment, the computer program executed by the processor can specifically implement the following steps: recording the test results of each test case in a table according to the test start time sequence of each test case.
[0121] The terms “first,” “second,” “third,” “fourth,” etc., used in this application (if applicable) are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, or apparatus that includes a series of steps or units is not necessarily limited to those explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, or apparatus.
[0122] It should be noted that the use of terms such as "first" and "second" in this application is for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of those features. Furthermore, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. If the combination of technical solutions is contradictory or impossible to implement, such a combination of technical solutions should be considered non-existent and not within the scope of protection claimed in this application.
[0123] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0124] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of readable storage medium known in the art.
[0125] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A server testing method, characterized in that, Applications in the control terminal include: If the execution command is obtained, the test tool is invoked to read the preset test cases in the control terminal, the test start time of each test case, and the number of test times; If the test start time of any test case is reached, the test case is executed repeatedly on the server under test according to the number of times the test case is tested. When the number of times the test case is executed repeatedly reaches the number of times the test case is tested, the test result of the test case is determined based on the results of each execution of the test case. If all test cases have been executed, the test results of all test cases will be recorded in a preset format. When any test case is executed on the server under test, a log file corresponding to the execution of the current test case is created in a preset directory, and the execution log of the current test case is recorded in the log file; The determination of the test result of the test case based on the execution results of each test case includes: Read the execution results of each test case from the preset directory; each execution result includes at least one test metric value; Calculate the average value of the same test metric in each execution result; The average value of the at least one test metric is recorded as the test result of the current test case; The step of calling the testing tool to read the preset test cases in the control terminal, the test start time and the number of tests for each test case, includes: A test command is sent to the controlled terminal to invoke the test tool in the controlled terminal to read each pre-set test case, the test start time of each test case, and the number of test attempts in the control terminal.
2. The method according to claim 1, characterized in that, The test metrics include: bandwidth, latency, and IOPS.
3. The method according to claim 1, characterized in that, The step of reading the execution results of the current test case from the preset directory includes: Traverse each log file in the preset directory to obtain the execution results of each test case.
4. The method according to any one of claims 1-3, characterized in that, The test results of all test cases are recorded according to a preset format, including: Record the test results of each test case in a table according to the order of test start time.
5. A server testing device, characterized in that, Applications in the control terminal include: The calling module is used to call the test tool to read the preset test cases, test start time and test count of each test case in the control terminal if a run instruction is obtained; The testing module is used to execute the test case repeatedly on the server under test according to the number of times the test case is tested when the test start time of any test case is reached. When the number of times the test case is executed repeatedly reaches the number of times the test case is tested, the test result of the test case is determined based on the execution results of each test case. The recording module is used to record the test results of all test cases in a preset format if all test cases have been executed. The logging module is used to create a log file corresponding to the current execution of any test case in a preset directory when any test case is executed on the server under test, and to record the execution log of the current test case to the log file. Specifically, the testing module is used for: Read the execution results of each test case from the preset directory; each execution result includes at least one test metric value; Calculate the average value of the same test metric in each execution result; The average value of the at least one test metric is recorded as the test result of the current test case; Specifically, the calling module is used for: A test command is sent to the controlled terminal to invoke the test tool in the controlled terminal to read each pre-set test case, the test start time of each test case, and the number of test attempts in the control terminal.
6. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the method as described in any one of claims 1 to 4.
7. A readable storage medium, characterized in that, Used to store a computer program, wherein the computer program, when executed by a processor, implements the method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Server IO performance test method and device, equipment and medium
CN111290895A
Automatic testing method and device thereof
CN112416803A