A test management method, system and apparatus
Patent Information
- Application Number
- CN202211263424.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-14
- Publication Date
- 2026-09-25
- Estimated Expiration
- 2042-10-14
AI Technical Summary
[0003]为了加快研发迭代速度,往往需要对测试过程中发现的问题修复后及时将修复后的存储系统更新到测试服务器进行回归测试,回归测试时可以使用jenkins工具将修复后的存储系统的信息添加至测试服务器,但是由于修复也需要一定的时间,修复完成时可能其之前测试所使用的测试服务器此时已经再使用,测试服务器改变之后,安装在测试服务器上的用于测试存储系统的测试组件也会随之改变,这时还需要手动的添加此次测试需要的测试组件,手动编译该测试组件,而jenkins工具在测试环境改变时并不适用,也就是测试服务器改变后继续使用jenkins工具会有大量的人工修改过程,例如前边提到的修改测试组件和编译测试组件,人工处理的过程较为繁琐,且会增加出错的概率
[0035]本申请提供了一种测试管理方法、系统及装置。接收到测试指令时,确定当前可用的测试服务器;确定测试组件库中与测试指令对应的测试组件;调用对应测试组件的编译脚本并基于编译脚本编译测试组件;基于测试组件-测试服务器对应关系将编译后的测试组件发送至与测试组件对应的测试服务器并控制测试组件开启。本申请首先确定当前可用的测试服务器,然后根据预先存储的测试组件库获取与测试指令对应的测试组件,自动化调用该测试组件的编译脚本并编译该编译脚本,然后将编译后的测试组件发送至确定的当前可用的测试服务器并启动测试组件。整个过程自动化进行不需要人工部署测试组件,提高了方案的自动化程度,提高了可靠性。
Smart Images

Figure CN115543826B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of management, and in particular to a test management method, system and apparatus. Background Technology
[0002] During the development of storage systems, multiple rounds of testing are often required to ensure the reliability of the storage system's functions. Current technology requires installing an ISO image of the storage system onto a test server before testing can begin. This method involves developers fixing problems identified during the current test, and then creating another ISO image for the next test. However, creating an ISO image for each subsequent test requires a significant timeframe.
[0003] To accelerate R&D iteration, it's often necessary to fix issues discovered during testing and promptly update the repaired storage system to the test server for regression testing. Jenkins tools can be used to add the repaired storage system information to the test server during regression testing. However, since repairs take time, the test server used for the previous tests may be in use by the time the repair is complete. After the test server changes, the test components installed on the test server for testing the storage system will also change. This requires manually adding and compiling the necessary test components. Jenkins tools are not suitable for changes in the test environment; continuing to use Jenkins after a test server change involves a significant amount of manual modification, such as modifying and compiling test components as mentioned earlier. This manual process is tedious and increases the probability of errors. Summary of the Invention
[0004] The purpose of this invention is to provide a test management method, system, and apparatus. First, an available test server is determined. Then, a test component corresponding to the test instruction is retrieved from a pre-stored test component library. The compilation script for that test component is automatically invoked and compiled. Finally, the compiled test component is sent to the determined available test server and the test component is started. The entire process is automated, eliminating the need for manual deployment of test components, thus improving the automation level and reliability of the solution.
[0005] To address the aforementioned technical problems, this invention provides a test management method applied to the processor of a management node, comprising:
[0006] Upon receiving a test command, determine the currently available test servers;
[0007] Identify the test component in the test component library that corresponds to the test instruction;
[0008] Invoke the compilation script corresponding to the test component and compile the test component based on the compilation script;
[0009] Based on the test component-test server correspondence, the compiled test component is sent to the test server corresponding to the test component, and the test component is controlled to start.
[0010] Preferably, before sending the compiled test component to the test server corresponding to the test component based on the test component-test server correspondence and controlling the start of the test component, the method further includes:
[0011] Generate a key for encryption;
[0012] Send the public key corresponding to the key for decryption to the test server.
[0013] Preferably, generating a key for encryption includes:
[0014] Invoke the sshkey-gen command and generate a key for encryption based on the sshkey-gen command;
[0015] Sending the public key for decryption corresponding to the key to the test server, including:
[0016] The ssd-copy-id command is invoked, and the public key for decryption corresponding to the key is sent to the test server based on the ssd-copy-id command.
[0017] Preferably, sending the compiled test component to the test server corresponding to the test component includes:
[0018] The distribution and push tool is invoked, and the compiled test component is sent to the test server corresponding to the test component based on the distribution and push tool.
[0019] Preferably, sending the compiled test component to the test server corresponding to the test component includes:
[0020] The compiled test components are sent sequentially to the test server corresponding to the test components in a preset order.
[0021] Preferably, before determining the test component in the test component library corresponding to the test instruction, the method further includes:
[0022] Upon receiving a test component change instruction, the test component library is constructed according to the test component change instruction.
[0023] Preferably, sending the compiled test component to the test server corresponding to the test component includes:
[0024] The compiled executable script of the test component is sent to the test server corresponding to the test component.
[0025] Preferably, upon receiving a test instruction, before determining the currently available test server, the process further includes:
[0026] Upon receiving a test server change instruction, a test resource configuration file is constructed based on the test server change instruction. The test resource configuration file includes the currently available test servers.
[0027] To address the aforementioned technical problems, the present invention also provides a test management system, comprising:
[0028] The test server determination unit is used to determine the currently available test servers when a test instruction is received.
[0029] A test component determination unit is used to determine the test component in the test component library that corresponds to the test instruction;
[0030] The calling and compilation unit is used to call the compilation script corresponding to the test component and compile the test component based on the compilation script;
[0031] The processing unit is used to send the compiled test component to the test server corresponding to the test component based on the test component-test server correspondence and to control the test component to start.
[0032] To address the aforementioned technical problems, the present invention also provides a test management device, comprising:
[0033] Memory, used to store computer programs;
[0034] A processor for executing the computer program to implement the steps of the test management method described above.
[0035] This application provides a test management method, system, and apparatus. Upon receiving a test instruction, the following steps are taken: First, an available test server is determined. Then, the test component corresponding to the test instruction is identified from the test component library. Next, the compilation script for the corresponding test component is invoked, and the test component is compiled based on the compilation script. Finally, based on the test component-test server correspondence, the compiled test component is sent to the corresponding test server, and the test component is started. This application first determines the available test server, then retrieves the test component corresponding to the test instruction from the pre-stored test component library, automatically invokes and compiles the compilation script for that test component, and then sends the compiled test component to the determined available test server and starts the test component. The entire process is automated, eliminating the need for manual deployment of test components, thus improving the automation level and reliability of the solution. Attached Figure Description
[0036] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the prior art and embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0037] Figure 1 A flowchart of a test management method provided by the present invention;
[0038] Figure 2 A schematic diagram of the structure of a test management system provided by the present invention;
[0039] Figure 3 This is a schematic diagram of a test management device provided by the present invention. Detailed Implementation
[0040] The core of this invention is to provide a test management method, system, and apparatus. First, an available test server is determined. Then, a test component corresponding to the test instruction is retrieved from a pre-stored test component library. The compilation script for that test component is automatically invoked and compiled. Finally, the compiled test component is sent to the determined available test server and the test component is started. The entire process is automated, eliminating the need for manual deployment of test components, thus improving the automation level and reliability of the solution.
[0041] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0042] Please refer to Figure 1 , Figure 1 A flowchart illustrating a test management method provided by the present invention. This method is applied to the processor of a management node and includes:
[0043] S11: Upon receiving a test command, determine the currently available test servers;
[0044] Upon receiving a test command, it indicates that testing of the storage system is about to begin. At this point, it is necessary to determine which test servers are currently available. Since the test servers used during the test may change, it is essential to first identify the currently available test servers and then perform subsequent tests on the storage system based on these available test servers, thereby improving the reliability of the solution.
[0045] It should be noted that the information of the currently available test servers is pre-stored inside the processor of the management node. When a test command is received, it is only necessary to determine the identification information of the currently stored test server. The identification information can be, but is not limited to, number, name, etc., and can be set according to actual needs, which improves the flexibility of the solution.
[0046] S12: Determine the test component in the test component library that corresponds to the test instruction;
[0047] The test component library is also pre-stored inside the processor. This test component library includes the identification information of the test components. Based on the received test instructions, the specific information of the project to be tested can be known, and thus it can be known which test components should be called for testing. Therefore, it is necessary to determine the test component in the test component library that corresponds to the test instructions, so that the corresponding operation can be performed on the test component in the future, thereby improving the reliability of the solution.
[0048] S13: Call the compilation script of the corresponding test component and compile the test component based on the compilation script;
[0049] Next, the compiler scripts corresponding to the test component are called from its own storage. These compiler scripts are pre-stored inside the processor. When in actual use, these compiler scripts are called directly, and the test component is compiled based on the compiler scripts. After compilation, the test component can be used and then the test of the storage system is executed. The whole process is automated, which improves the automation level of the solution.
[0050] Add the component identifiers, code repository addresses, branch names, and compilation instructions for all component services that need to be updated to the test environment to the compilation configuration file. The compilation configuration file is the test component library mentioned in this application. The specific steps for calling the compilation script are to pull the code of each test component from the specified address and branch, and compile it using the compilation instructions. The compilation configuration file is line-based, with each line configuring one test component service, including the component name, Git code repository address, branch name, and compilation instructions, with each field value separated by the character "=". The compilation configuration file is used to specify information related to each test component, also line-based, with each line specifying information related to one test component. It mainly includes three parts: the code repository address, code branch name, and compilation instructions for each test component, separated by "=", as shown below:
[0051] git@192.168.167.103:project / server1.git=master=go build-o server1
[0052] git@192.168.167.103:project / server2.git=develop=make
[0053] git@192.168.167.103:project / server3.git=develop=gcc main.c-oserver3
[0054] S14: Based on the test component-test server correspondence, send the compiled test component to the test server corresponding to the test component and control the test component to start.
[0055] After compiling the test component, the storage system can be tested based on the compiled test component. At this point, it is necessary to determine which test servers among the non-management node test servers need to have the test component installed. This can be determined by the correspondence between the test components and test servers stored in the processor. The correspondence between the test components and test servers is also pre-stored in the processor. If some test servers are added or deleted, the correspondence will change accordingly. It is only necessary to store the new correspondence in the processor and overwrite the original correspondence. The whole process is automated, which improves the automation level of the solution.
[0056] Next, the test components that have been sent to the test server can be started remotely. After the test components are started using the remote control tool, the storage system can be tested. This solution can perform testing in a timely manner after the storage system has been fixed, and the entire testing process is automated, eliminating the need for manual intervention, reducing the probability of errors and improving the efficiency of the solution.
[0057] Specifically, the mapping between test components and test servers can be used as a distribution configuration file. This file should be filled out according to a specified format, including the test component service name, the path to the component, and a list of test servers where the component needs to be deployed. The `section` value is the component name, and the `key` values below include the storage path of the test component, the list of test servers that need to update the component, and the corresponding component service startup management command. The distribution configuration file specifies which component services will be updated on which servers. It uses an `ini` format, with each section representing one component service. For example, component 1 needs to be updated to the ` / usr / bin` path on three specified servers, and component 2 needs to be updated to the ` / usr / local / bin` path on two specified servers.
[0058] [component1]
[0059] path= / usr / bin
[0060] service_cmd=systemctl stop / start component1.service
[0061] host_list=[192.168.167.1, 192.168.167.2, 192.168.167.3]
[0062] [component2]
[0063] path= / usr / local / bin
[0064] service_cmd=systemctl stop / start component2.service
[0065] host_list=[192.168.167.1, 192.168.167.3]
[0066] [component3]
[0067] path= / usr / bin
[0068] service_cmd=systemctl stop / start component3.service
[0069] host_list=[192.168.167.4, 192.168.167.5]
[0070] It should be noted that the system reads and parses the distribution configuration file to obtain the list of servers and path information that need to be updated for each test component, as well as the commands corresponding to manage the services of that component. This invention proposes a testing method for a variable testing environment, which can minimize the number of manual interventions caused by changes in the testing environment and improve the efficiency of updating the testing environment. In scenarios where the testing environment changes frequently, users only need to modify the configuration file as needed each time, resulting in a significant improvement in manageability and efficiency.
[0071] In summary, this application provides a test management method. Upon receiving a test instruction, it determines the currently available test server; identifies the test component in the test component library corresponding to the test instruction; calls the compilation script of the corresponding test component and compiles the test component based on the compilation script; and sends the compiled test component to the corresponding test server based on the test component-test server mapping and controls the test component to start. This application first determines the currently available test server, then retrieves the test component corresponding to the test instruction from the pre-stored test component library, automatically calls and compiles the compilation script of the test component, and then sends the compiled test component to the determined currently available test server and starts the test component. The entire process is automated and does not require manual deployment of test components, improving the automation level and reliability of the solution.
[0072] Based on the above embodiments:
[0073] As a preferred embodiment, before sending the compiled test component to the test server corresponding to the test component based on the test component-test server correspondence and controlling the start of the test component, the method further includes:
[0074] Generate a key for encryption;
[0075] Send the corresponding public key for decryption to the test server.
[0076] Before sending the compiled test components to the test server, a connection needs to be established between the management node and the test server of the non-management node. Before the processor of the management node sends the test components, a key for encryption is generated, and then the public key for decryption corresponding to the key is sent to the test server. When data is transmitted, the data can be sent directly to the test server to achieve passwordless access. This makes the information exchange between the management node and the test server more reliable, achieves passwordless access, and improves the efficiency of data transmission.
[0077] As a preferred embodiment, generating a key for encryption includes:
[0078] Invoke the sshkey-gen command and generate a key for encryption based on the sshkey-gen command;
[0079] Send the corresponding public key used for decryption to the test server, including:
[0080] The ssd-copy-id command is invoked, and the public key for decryption corresponding to the key is sent to the test server based on the ssd-copy-id command.
[0081] The process of generating the key and public key involves calling the `sshkey-gen` command to generate the key for encryption, and then calling the `ssd-copy-id` command to send the corresponding public key for decryption to the test server. These two commands enhance the reliability of the generated key and public key. The key and public key can be generated using only commands, and the process can efficiently generate them based on the processor control of the management node, thus improving the reliability of the solution.
[0082] Specifically, the system generates a key pair by calling the `sshkey-gen` command on the management node. Next, the system reads the identification information of the test servers and, for each test server, uses a specified username and password to call the `ssd-copy-id` command to copy the public key to the corresponding test server. Furthermore, if this is the first time the system is copying the public key, a marker file will be generated in the current directory after execution to indicate that the management node can now access the test servers without a password. This step is not necessary for subsequent system runs.
[0083] As a preferred embodiment, sending the compiled test component to the test server corresponding to the test component includes:
[0084] Invoke the distribution and push tool and send the compiled test component to the test server corresponding to the test component based on the distribution and push tool.
[0085] When sending test components to the test server, the distribution and push tool needs to be called first. Then, based on the distribution and push tool, the compiled test components are sent to the test server. Using the distribution and push tool can make the data transmission more reliable and improve the reliability of the solution.
[0086] In a preferred embodiment, the compiled test component is sent to the test server corresponding to the test component, including:
[0087] The compiled test components are sent to the test servers corresponding to the test components in a preset order.
[0088] The process of sending compiled test components to their corresponding test servers follows a pre-defined order. Test servers are numbered based on their identifiers, and the next test component is sent only after the current one has been sent. This ensures a more organized and reliable data transmission process, and also simplifies management for the processor. Secondly, the management node remotely executes commands on each server list for each test component, shutting down the corresponding service, copying the compiled binary program to the corresponding test server's path via remote replication, and finally remotely executing a service startup command to start the component. This entire process is automated, significantly improving the overall automation of the solution.
[0089] As a preferred embodiment, before determining the test component in the test component library corresponding to the test instruction, the method further includes:
[0090] When a test component change instruction is received, the test component library is built according to the test component change instruction.
[0091] Since the test component library is pre-built, it is stored in the processor during storage system testing. If the currently used test component needs to be changed, a test component change instruction can be sent to the processor, and the processor will rebuild the test component library according to the change instruction, which improves the flexibility of the solution.
[0092] In a preferred embodiment, the compiled test component is sent to the test server corresponding to the test component, including:
[0093] The compiled executable script of the test component is sent to the test server corresponding to the test component.
[0094] When sending test components, only the compiled executable script of the test component needs to be sent to the test server. The test server then uses this executable script to perform tests on the storage system. The executable script is the main part of the compiled test component; by using this part, the storage system test can be carried out, thus improving the reliability of the solution. After copying the executable scripts of each test component to the specified path in the corresponding server list and starting the test component service, the storage system test can be performed.
[0095] As a preferred embodiment, upon receiving a test instruction, before determining the currently available test server, the method further includes:
[0096] Upon receiving a test server change instruction, a test resource configuration file is constructed based on the instruction. The test resource configuration file includes currently available test servers.
[0097] The test resource configuration file can be built according to the test server change instructions. When the current test server changes, the built test resource configuration file will be modified so that the subsequent test process can use the currently available test server. Once a test server is added or deleted, the corresponding test resource configuration file will also be changed, which improves the feasibility of the solution.
[0098] Specifically, all potentially usable test server information is added to the test resource configuration file. The test resource configuration file is line-based, with each line adding one piece of test server information, including IP address, username, and login password. The test resource configuration file is essentially a list of usable server resources, used to limit the set of test servers that can be used. The test resource configuration file is line-based, with each line adding one piece of server information, including three fields: IP address, username, and login password, separated by spaces, as shown below.
[0099] 192.168.167.1root passw0rd1
[0100] 192.168.167.2root passw0rd2
[0101] 192.168.167.3 root passw0rd3
[0102] 192.168.167.4root passw0rd4
[0103] 192.168.167.5root passw0rd5
[0104] This application can achieve the following functions: 1. Configuration analysis function: reads test resource files, compilation configuration files, distribution configuration files, and other related files, extracts key information and corresponding field values, and provides basic services. 2. Remote management function: based on the analysis results of test resource files, automatically configures passwordless remote access for each test server, facilitating the push of executable scripts for each test component that needs updating; simultaneously, it receives information pushed by test components and remotely shuts down or starts the corresponding test component service as needed. 3. Compilation and execution function: based on the analysis of compilation configuration files, automatically pulls code from a specified branch in a specified repository and calls the corresponding compilation instructions to compile the corresponding test component. 4. Distribution and push function: based on the analysis of distribution configuration files, pushes each test component to a specified test server. 5. Log recording function: records key execution steps and information during the running process through logs, facilitating problem tracking and analysis, and improving the reliability of the solution.
[0105] Please refer to Figure 2 , Figure 2 This is a schematic diagram of the structure of a test management system provided by the present invention.
[0106] The present invention also provides a test management system, comprising:
[0107] The test server determination unit 10 is used to determine the currently available test servers when a test instruction is received;
[0108] Test component determination unit 11 is used to determine the test component in the test component library that corresponds to the test instruction;
[0109] The calling and compiling unit 12 is used to call the compilation script corresponding to the test component and compile the test component based on the compilation script;
[0110] Processing unit 13 is used to send the compiled test component to the test server corresponding to the test component based on the test component-test server correspondence and control the test component to start.
[0111] Prior to the processing unit, it also includes:
[0112] A key generation unit is used to generate keys for encryption.
[0113] The public key sending unit is used to send the public key for decryption of the corresponding key to the test server.
[0114] The key generation unit includes:
[0115] Invoke the sshkey-gen command and generate a key for encryption based on the sshkey-gen command;
[0116] The public key sending unit includes:
[0117] The ssd-copy-id command is invoked, and the public key for decryption corresponding to the key is sent to the test server based on the ssd-copy-id command.
[0118] The processing unit includes:
[0119] Invoke the distribution and push tool and send the compiled test component to the test server corresponding to the test component based on the distribution and push tool.
[0120] The processing unit includes:
[0121] The compiled test components are sent to the test servers corresponding to the test components in a preset order.
[0122] Before determining the test component unit, the following steps are also included:
[0123] When a test component change instruction is received, the test component library is built according to the test component change instruction.
[0124] The processing unit includes:
[0125] The compiled executable script of the test component is sent to the test server corresponding to the test component.
[0126] Before the test server determines the unit, it also includes:
[0127] Upon receiving a test server change instruction, a test resource configuration file is constructed based on the instruction. The test resource configuration file includes currently available test servers.
[0128] For a description of the test management system provided by this invention, please refer to the embodiments of the test management method described above; further details will not be repeated here.
[0129] Please refer to Figure 3 , Figure 3 This is a schematic diagram of a test management device provided by the present invention.
[0130] The present invention also provides a test management device, comprising:
[0131] Memory 1 is used to store computer programs;
[0132] Processor 2 is used to execute the computer program to implement the steps of the test management method described above.
[0133] For a description of the test management device provided by the present invention, please refer to the embodiments of the test management method described above, which will not be repeated here.
[0134] It should also be noted that, in this specification, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0135] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0136] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A test management method, characterized in that, The processors used in the management node include: Upon receiving a test server change instruction, a test resource configuration file is constructed according to the test server change instruction. The test resource configuration file includes the currently available test servers. The test resource configuration file is organized by line, with each line adding one test server information. The test server information includes IP address, username, and login password, with each field value separated by a space. Upon receiving a test command, determine the currently available test servers; Identify the test components in the test component library that correspond to the test instructions; the compilation configuration file is the test component library. The compilation configuration file is line-by-line, with each line configuring a test component service, including the component name, git code repository address, branch name, and compilation instructions, with the values of each field separated by the character "=". Call the compilation script corresponding to the test component and compile the test component based on the compilation script; wherein, calling the compilation script corresponding to the test component and compiling the test component based on the compilation script includes: pulling the code of each test component from the git code repository address and the branch name, and compiling it using the corresponding compilation instructions; Based on the test component-test server correspondence, the compiled test component is sent to the test server corresponding to the test component and the test component is controlled to start; wherein, the test component-test server correspondence is a distribution configuration file, the distribution configuration file adopts the ini format, each section represents a component service, the value of the section is the component name, and the key value under the section includes the test component storage path, the list of test servers that need to update the test component, and the corresponding component service start management command; Based on the test component-test server correspondence, the compiled test component is sent to the test server corresponding to the test component, and the test component is controlled to start, including: Read and parse the distribution configuration file to obtain the list of servers that need to be updated for each test component, path information, and commands corresponding to managing the services of that component; The management node remotely executes commands on the server list under each test component one by one to shut down the corresponding component's service. Then, it remotely copies the compiled binary program to the test component's storage path on the corresponding test server. Finally, it remotely executes the service startup command to start the component, thereby controlling the start of the test component. Before sending the compiled test component to the test server corresponding to the test component based on the test component-test server mapping and controlling the start of the test component, the process also includes: Generate a key for encryption; Send the public key corresponding to the key used for decryption to the test server; Generate a key for encryption, including: Invoke the sshkey-gen command and generate a key for encryption based on the sshkey-gen command; Sending the public key for decryption corresponding to the key to the test server, including: Read the identification information of the test server. For each test server, use the specified username and password to call the ssd-copy-id command and send the public key for decryption corresponding to the key to the test server based on the ssd-copy-id command. When the operation of sending the public key to the test server is executed for the first time, after the execution is completed, a marker file is generated in the current path of the management node. The marker file is used to identify that the management node can access the test server without a password.
2. The test management method as described in claim 1, characterized in that, Sending the compiled test component to the test server corresponding to the test component includes: The distribution and push tool is invoked, and the compiled test component is sent to the test server corresponding to the test component based on the distribution and push tool.
3. The test management method as described in claim 1, characterized in that, Sending the compiled test component to the test server corresponding to the test component includes: The compiled test components are sent sequentially to the test server corresponding to the test components in a preset order.
4. The test management method as described in claim 1, characterized in that, Before determining the test component in the test component library corresponding to the test instruction, the process also includes: Upon receiving a test component change instruction, the test component library is constructed according to the test component change instruction.
5. The test management method as described in claim 1, characterized in that, Sending the compiled test component to the test server corresponding to the test component includes: The compiled executable script of the test component is sent to the test server corresponding to the test component.
6. A test management system, characterized in that, include: Upon receiving a test server change instruction, a test resource configuration file is constructed according to the test server change instruction. The test resource configuration file includes the currently available test servers. The test resource configuration file is organized by line, with each line adding one test server information. The test server information includes IP address, username, and login password, with each field value separated by a space. The test server determination unit is used to determine the currently available test servers when a test instruction is received. The test component determination unit is used to determine the test component in the test component library that corresponds to the test instruction; the compilation configuration file is the test component library. The compilation configuration file is line-based, with each line configuring a test component service, including the component name, git code repository address, branch name, and compilation instruction, with the values of each field separated by the character "=". The calling and compilation unit is used to call the compilation script corresponding to the test component and compile the test component based on the compilation script; wherein, calling the compilation script corresponding to the test component and compiling the test component based on the compilation script includes: pulling the code of each test component from the git code repository address and the branch name, and compiling it using the corresponding compilation instructions; The processing unit is configured to send the compiled test component to the test server corresponding to the test component based on the test component-test server correspondence and control the test component to start; wherein, the test component-test server correspondence is a distribution configuration file, the distribution configuration file adopts the ini format, each section represents a component service, the value of the section is the component name, and the key value under the section includes the test component storage path, the list of test servers that need to update the test component, and the corresponding component service start management command; Based on the test component-test server correspondence, the compiled test component is sent to the test server corresponding to the test component, and the test component is controlled to start, including: Read and parse the distribution configuration file to obtain the list of servers that need to be updated for each test component, path information, and commands corresponding to managing the services of that component; The management node remotely executes commands on the server list under each test component one by one to shut down the corresponding component's service. Then, it remotely copies the compiled binary program to the test component's storage path on the corresponding test server. Finally, it remotely executes the service startup command to start the component, thereby controlling the start of the test component. The key generation unit is used to invoke the sshkey-gen command and generate a key for encryption based on the sshkey-gen command; The public key sending unit is used to read the identification information of the test server. For each test server, it uses a specified username and password to call the ssd-copy-id command and sends the corresponding public key for decryption to the test server based on the ssd-copy-id command. Specifically, when the operation of sending the public key to the test server is performed for the first time, a marker file is generated in the current path of the management node after the operation is completed. The marker file is used to identify that the management node can access the test server without a password. The test management system is also used to construct a test resource configuration file based on the test server change instruction when it receives the test server change instruction. The test resource configuration file includes the currently available test servers.
7. A test management device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the test management method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Configuration method and device for benchmark test component
CN103559134A