Test management system
By introducing container technology and test management system, the problem of complex construction of traditional test environments and difficult to ensure test consistency is solved, and simplified construction of test environments and improved test consistency is achieved.
Patent Information
- Application Number
- CN202411773786.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-03-28
AI Technical Summary
In functional/performance testing, traditional methods are difficult to achieve the exact same test environment, making it difficult to ensure test consistency, and the test environment is complex, increasing the workload and difficulty.
Use container technology to build a test environment and process test tasks. Through the test resource library, test database, test server and test container pool in the test management system, container creation, query, deletion and task management are realized.
It reduces the difficulty and workload of building a test environment, improves the consistency of the test, and makes the test results more objective and reliable.
Smart Images

Figure CN119718918A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a test management system. Background Art
[0002] Under normal circumstances, when performing functional / performance tests on multiple heterogeneous devices (hosts, virtual machines, servers, systems or platforms) that provide the same service, it is best to test them based on a test system with the same software / hardware resource configuration, so that the test results obtained will be more objective. This is called test consistency in the testing field. However, in the traditional test environment construction process, due to the limitations of hardware and operating systems, it is difficult for testers to achieve exactly the same test environment. In addition, in the traditional test environment construction process, testers are required to perform installation and configuration operations manually or semi-manually, which will undoubtedly increase the testing workload and increase the difficulty of test environment construction. Summary of the invention
[0003] The purpose of the present invention is to provide a test management system in view of the defects of the prior art, the system comprising: a test resource library, a test database, a test server and a test container pool; the test resource library is used to store multiple first test images; the test database is used to store a container monitoring information table and a test task information table; the test server is used to process container creation / query / deletion tasks, and is also used to process test task creation / query tasks, and is also used to monitor / update container status and task information. The present invention introduces container technology to build a test environment and process test tasks, which can not only reduce the difficulty of setting up a test environment, reduce the workload of setting up a test environment, but also improve test consistency.
[0004] To achieve the above-mentioned purpose, an embodiment of the present invention provides a test management system, the system comprising: a test resource library, a test database, a test server and a test container pool;
[0005] The test server is connected to the test resource library, the test database and the test container pool respectively; the test server is also connected to a first client outside the system; each test container in the test container pool is connected to a first testee outside the system respectively; the first testee is a carrier device, host, virtual machine, server, system or platform of a type of tested service; the tested service interfaces of all the first testees are the same, but the software / hardware resource configurations are different;
[0006] The test resource library is used to store multiple first test images;
[0007] The test database is used to store the container monitoring information table and the test task information table;
[0008] The test server is used to receive a first container creation request sent by the first client; and perform container creation processing according to the first container creation request and the test database to obtain a corresponding first creation result and send it back to the first client; the first container creation request includes a new container identifier, a tested target IP address, a tested target Cyber RT communication domain identifier, a tested target configuration description, a tested target login account, and a tested target login password; the first creation result includes success and failure;
[0009] The test server is also used to receive a first container query request sent by the first client; and perform container query processing according to the first container query request and the test database to obtain a corresponding first query result and send it back to the first client; the first container query request includes a first query mode and a first query parameter; the first query model includes a first mode and a second mode; when the first query model is the first mode, the first query parameter is empty; when the first query model is the second mode, the first query parameter consists of one or more query container identifiers;
[0010] The test server is also used to receive a first container deletion request sent by the first client; and perform container deletion processing according to the first container deletion request and the test database to obtain a corresponding first deletion result and send it back to the first client; the first container deletion request includes a first deletion mode and a first deletion parameter; the first deletion model includes a third mode and a fourth mode; when the first deletion model is the third mode, the first deletion parameter is empty; when the first deletion model is the fourth mode, the first deletion parameter consists of one or more deletion container identifiers; the first deletion result includes success and failure;
[0011] The test server is also used to receive a first task creation request sent by the first client; and perform test task creation processing according to the first task creation request, the test resource library and the test database to obtain a corresponding second creation result and send it back to the first client; the first task creation request includes an allocation container identifier, a test task identifier and a test image identifier; the second creation result includes success and failure;
[0012] The test server is also used to receive a first task query request sent by the first client; and perform test task query processing according to the first task query request and the test database to obtain a corresponding second query result and send it back to the first client; the first task query request includes a second query mode and a second query parameter; the second query model includes a fifth mode and a sixth mode; when the second query model is the fifth mode, the second query parameter is empty; when the second query model is the sixth mode, the second query parameter consists of one or more query task identifiers;
[0013] The test server is also used to regularly update container status and task information.
[0014] Preferably, each of the first test images corresponds to a set of image configuration parameters, and the image configuration parameters include at least a first image identifier, a first image name, a first image version, a first test main program path, a first test report storage path, a first test main program file name and a first report file name; the first image identifier is a unique identifier of the current test image; the first image name and the first image version are the name and version of the current test image; the first test main program path is the storage location of the test main program of the current test image in the current image environment; the first test report storage path is the storage location of the test report output by the test main program of the current test image in the current image environment; the first test main program file name is the file name of the test main program of the current test image; the first report file name is the file name of the test report output by the test main program of the current test image;
[0015] The container monitoring information table includes a plurality of first container monitoring records; the first container monitoring record corresponds to one test container; the first container monitoring record includes a first container identifier, a first measured target IP address, a first measured target Cyber RT communication domain identifier, a first measured target configuration description, a first measured target login account, a first measured target login password, a first assigned task identifier, and a first container status; the first container identifier is a unique identifier of the current test container; the first measured target IP address is an IP address of the first measured person corresponding to the current test container; the first measured target Cyber RT communication domain identifier is a Cyber RT communication domain identifier of the first measured person corresponding to the current test container; the first measured target configuration description is a software / hardware resource configuration description of the first measured person corresponding to the current test container; the first measured target login account and the first measured target login password are the SSH channel login username and password of the first measured person corresponding to the current test container; the first assigned task identifier is a test task identifier assigned to the current test container; the first container status includes creation, running, stopping, and deletion;
[0016] The test task information table includes multiple first test task records; the first test task records correspond to test tasks one by one; the first test task record includes a first test task identifier, a first test image identifier and a first test report; the first test task identifier is a unique identifier of the current test task; the first test image identifier is the first image identifier of the first test image corresponding to the current test task; the first test report is a test report corresponding to the current test task, and the first test report is empty when the current test task is not completed.
[0017] Preferably, the test server is specifically configured to, when the container creation process is performed according to the first container creation request and the test database to obtain a corresponding first creation result and send it back to the first client:
[0018] Step 31, extracting the corresponding new container identifier, the measured target IP address, the measured target Cyber RT communication domain identifier, the measured target configuration description, the measured target login account and the measured target login password from the first container creation request as the corresponding current container identifier, current IP address, current communication domain identifier, current configuration description, current login account and current login password;
[0019] Step 32, and take the first container monitoring record in the container monitoring information table of the test database whose first container identifier matches the current container identifier and whose first container status is not deleted as the corresponding current monitoring record; and identify whether the current monitoring record is empty; if not, set the corresponding first creation result to failure, and go to step 34; if yes, go to step 33;
[0020] Step 33, adding a new first container monitoring record in the container monitoring information table as the corresponding current newly added record; and setting the first container identifier, the first measured target IP address, the first measured target Cyber RT communication domain identifier, the first measured target configuration description, the first measured target login account and the first measured target login password of the current newly added record to the corresponding current container identifier, the current IP address, the current communication domain identifier, the current configuration description, the current login account and the current login password; and setting the first assigned task identifier of the current newly added record to empty; and setting the first container status of the current newly added record to creation; and setting the corresponding first creation result to success;
[0021] Step 34: Send the first creation result obtained this time back to the first client.
[0022] Preferably, the test server is specifically configured to, when the container query processing is performed according to the first container query request and the test database to obtain a corresponding first query result and send it back to the first client:
[0023] Step 41: extracting the first query mode and the first query parameter corresponding to the first container query request as the corresponding current query mode and current query parameter;
[0024] Step 42: if the current query mode is the first mode, taking the container monitoring information table of the test database as the corresponding first query result;
[0025] Step 43: if the current query mode is the second mode, extract the first container monitoring records in the container monitoring information table whose first container identifier matches each query container identifier of the current query parameter as corresponding first query records; and form the corresponding first query result from all the first query records obtained this time;
[0026] Step 44: Send the first query result obtained this time back to the first client.
[0027] Preferably, the test server is specifically configured to, when the first deletion result corresponding to the first deletion result is obtained by performing container deletion processing according to the first container deletion request and the test database and sending it back to the first client:
[0028] Step 51: extracting the first deletion mode and the first deletion parameter corresponding to the first container deletion request as the corresponding current deletion mode and current deletion parameter;
[0029] Step 52: if the current deletion mode is the third mode, the first container status of all the first container monitoring records in the container monitoring information table of the test database are set to be deleted; and all the test containers in the test container pool are deleted; if all container statuses and containers are successfully deleted, the corresponding first deletion result is set to be successful; if some container statuses or some containers are not successfully deleted, the corresponding first deletion result is set to be failed;
[0030] Step 53: if the current deletion mode is the fourth mode, the first container monitoring record in which the first container identifier in the container monitoring information table matches each of the deletion container identifiers of the current deletion parameter is recorded as a corresponding first deletion record; and the first container status of all the first deletion records is set to deletion; and the test containers corresponding to all the first deletion records in the test container pool are deleted; if the container status of all the first deletion records and the corresponding containers are successfully deleted, the corresponding first deletion result is set to success; if the container status of some of the first deletion records or the corresponding containers are not successfully deleted, the corresponding first deletion result is set to failure;
[0031] Step 54: Send the first deletion result obtained this time back to the first client.
[0032] Preferably, the test server is specifically configured to, when the test task creation process is performed according to the first task creation request, the test resource library and the test database to obtain a corresponding second creation result and send it back to the first client:
[0033] Step 61, extracting the corresponding allocated container identifier, the test task identifier and the test image identifier from the first task creation request as the corresponding current container identifier, current test task identifier and current test image identifier;
[0034] Step 62, and use the first container monitoring record in the container monitoring information table of the test database, in which the first container identifier matches the current container identifier and the first container status is created, as the corresponding current monitoring record; and identify whether the current monitoring record is empty; if so, set the corresponding second creation result to failure, and go to step 66; if not, go to step 63;
[0035] Step 63, taking the first test task record in the test task information table that matches the first test task identifier with the current test task identifier as the corresponding current task record; and identifying whether the current monitoring record is empty; if not, setting the corresponding second creation result to failure, and going to step 66; if so, going to step 64;
[0036] Step 64, setting the first assigned task identifier of the current monitoring record in the container monitoring information table to the corresponding current test task identifier; and adding a new first test task record in the test task information table as the corresponding current newly added record; and setting the first test task identifier and the first test image identifier of the current newly added record to the corresponding current test task identifier and the current test image identifier; and setting the first test report of the current newly added record to empty;
[0037] Step 65, and use the first test image whose first image identifier in the test resource library matches the current test image identifier as the corresponding current test image; and use the first test main program path and the first test main program file name corresponding to the current test image as the corresponding current test main program path and the current test main program file name; and use the first tested target IP address, the first tested target Cyber RT communication domain identifier, the first tested target login account and the first tested target login password of the current monitoring record as the corresponding current IP address, current communication domain identifier, current login account and current login password; and use the IP address that matches the current IP address and is in the Cyber RT communication domain identifier, the first tested target login account and the first tested target login password as the corresponding current IP address, current communication domain identifier, current login account and current login password. The first testee whose RT communication domain matches the current communication domain identifier is used as the corresponding current testee; and a corresponding test container is created for the current test image in the test container pool and recorded as the current test container; and a remote control channel is established with the current testee through the SSH channel connection method based on the current login account and the current login password in the running environment of the current test container and recorded as the corresponding current channel; and in the running environment of the current test container, the test main program corresponding to the current test main program path and the current test main program file name is started and run, and the current testee is tested through the current channel by the currently running test main program based on the built-in test process of the program; and when the test main program is started and run, the first container state of the current monitoring record in the container monitoring information table is set to running; and the corresponding second creation result is set to success;
[0038] Step 66: Send the second creation result obtained this time back to the first client.
[0039] Preferably, the test server is specifically configured to, when the test task query processing is performed according to the first task query request and the test database to obtain a corresponding second query result and send it back to the first client:
[0040] Step 71, extracting the corresponding second query mode and the second query parameter from the first task query request as the corresponding current query mode and current query parameter;
[0041] Step 72: if the current query mode is the fifth mode, taking the test task information table of the test database as the corresponding second query result;
[0042] Step 73, if the current query mode is the sixth mode, the first test task record that matches the first test task identifier of the test task information table with each query task identifier of the current query parameter is recorded as a corresponding second query record; and all the obtained second query records constitute the corresponding second query result;
[0043] Step 74: Send the second query result obtained this time back to the first client.
[0044] Preferably, the test server is specifically used to periodically traverse all the test containers in the test container pool at a preset first time frequency when periodically performing container status and task information update processing; and in this round of traversal, the currently traversed test container is used as the corresponding current container; and the first container monitoring record corresponding to the current container in the container monitoring information table of the test database is used as the corresponding current monitoring record; and the first test task record whose first test task identifier in the test task information table of the test database matches the first assigned task identifier of the current monitoring record is used as the corresponding current task record; and the first mirror in the test resource library is used as the corresponding current task record. The first test image whose image identifier matches the first test image identifier of the current task record is used as the corresponding current test image; and the first test report storage path and the first report file name of the current test image are used as the corresponding current test report storage path and the current report file name; and it is identified whether a file with a file name matching the current report file name is stored in the storage location of the current test report storage path under the running environment of the current test container. If so, the first container state of the current monitoring record of the container monitoring information table is set to stop and the first test report of the current task record of the test task information table is set to the corresponding current test report.
[0045] The embodiment of the present invention provides a test management system. As can be seen from the above content, the system includes: a test resource library, a test database, a test server and a test container pool; the test resource library is used to store multiple first test images; the test database is used to store a container monitoring information table and a test task information table; the test server is used to process container creation / query / deletion tasks, and is also used to process test task creation / query tasks, and is also used to monitor / update container status and task information. The embodiment of the present invention introduces container technology to build a test environment and process test tasks, which not only reduces the difficulty of setting up a test environment, reduces the workload of setting up a test environment, but also improves test consistency. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1A module structure diagram of a test management system provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0048] The embodiment of the present invention provides a test management system 1, such as Figure 1 As shown in the module structure diagram of a test management system provided by an embodiment of the present invention, the system mainly includes: a test resource library 11, a test database 12, a test server 13 and a test container pool 14.
[0049] The test server 13 is connected to the test resource library 11, the test database 12 and the test container pool 14 respectively; the test server 13 is also connected to the first client 2 outside the system. Each test container 141 in the test container pool 14 is respectively connected to a first testee 3 outside the system. It should be noted that the first client 2 is a type of input / output I / O interface, application / service interface, module, device, terminal, equipment, server, system or platform. The first testee 3 is a type of carrier device, host, virtual machine, server, system or platform for the service under test; the service interfaces of all first testees 3 are the same, but the software / hardware resource configurations are not the same.
[0050] (I) Test Resource Library 11:
[0051] The test resource library 11 of the embodiment of the present invention is used to store a plurality of first test images.
[0052] Here, each first test image of an embodiment of the present invention corresponds to a set of image configuration parameters, and the image configuration parameters include at least a first image identifier, a first image name, a first image version, a first test main program path, a first test report storage path, a first test main program file name and a first report file name; the first image identifier is a unique identifier of the current test image; the first image name and the first image version are the name and version of the current test image; the first test main program path is the storage location of the test main program of the current test image in the current image environment; the first test report storage path is the storage location of the test report output by the test main program of the current test image in the current image environment; the first test main program file name is the file name of the test main program of the current test image; the first report file name is the file name of the test report output by the test main program of the current test image.
[0053] It should be noted that each first test image in the embodiment of the present invention is an application image for testing, which includes all components required to run a test main program. All components mentioned here include at least: 1) system components or libraries at the operating system level or the operating system itself; 2) communication components or libraries at the communication level for supporting multiple types of communication protocols, such as CyberRT protocol library, SSH protocol library, UDP protocol library, etc.; 3) test task components or libraries at the test execution level for executing multiple types of test tasks, such as access module test components, MEC module test components, business module test components, etc.; 4) all tool components or libraries for assisting each test task component or library in data processing, such as log data processing components or libraries, image data processing components or libraries, video data processing components or libraries, point cloud data processing components or library, signal light data processing component or library, data consistency verification component or library, data frequency verification component or library, etc.; 5) one or more test data sets or test data files at the test data level to support all test function components or libraries; 6) a test main program for starting a complete test; 7) a test environment installation configuration program or batch file for installing and / or copying all the above systems, components, and programs to complete the test environment (that is, the mirror environment) and configuring all environmental parameters required for the test and all test directories (such as the file directory corresponding to the test main program path, the file directory corresponding to the test report storage path, etc.) in the built environment.
[0054] (II) Test database 12:
[0055] The test database 12 of the embodiment of the present invention is used to store a container monitoring information table and a test task information table.
[0056] Here, the container monitoring information table of the embodiment of the present invention includes multiple first container monitoring records; the first container monitoring record corresponds to a test container 141; the first container monitoring record includes a first container identifier, a first measured target IP address, a first measured target CyberRT communication domain identifier, a first measured target configuration description, a first measured target login account, a first measured target login password, a first assigned task identifier, and a first container status; the first container identifier is a unique identifier of the current test container; the first measured target IP address is the IP address of the first measured person 3 corresponding to the current test container; the first measured target CyberRT communication domain identifier is the CyberRT communication domain identifier of the first measured person 3 corresponding to the current test container; the first measured target configuration description is the software / hardware resource configuration description of the first measured person 3 corresponding to the current test container; the first measured target login account and the first measured target login password are the SSH (Secure Shell) channel login user name and password of the first measured person 3 corresponding to the current test container; the first assigned task identifier is the test task identifier assigned to the current test container; the first container status includes creation, running, stop and deletion.
[0057] Here, the test task information table of the embodiment of the present invention includes multiple first test task records; the first test task records correspond to the test tasks one by one; the first test task records include a first test task identifier, a first test image identifier and a first test report; the first test task identifier is a unique identifier of the current test task; the first test image identifier is the first image identifier of the first test image corresponding to the current test task; the first test report is a test report corresponding to the current test task, and the first test report is empty when the current test task is not completed.
[0058] (III) Test server 13:
[0059] The test server 13 of the embodiment of the present invention is used to receive a first container creation request sent by the first client 2; and perform container creation processing according to the first container creation request and the test database 12 to obtain a corresponding first creation result and send it back to the first client 2.
[0060] Here, the first container creation request of the embodiment of the present invention includes a new container identifier, an IP address of the target under test, a CyberRT (Cyber Robotic Technology) communication domain identifier of the target under test, a configuration description of the target under test, a login account of the target under test, and a login password of the target under test; the first creation result includes success and failure.
[0061] The test server 13 is further configured to receive a first container query request sent by the first client 2 ; and perform container query processing according to the first container query request and the test database 12 to obtain a corresponding first query result and send it back to the first client 2 .
[0062] Here, the first container query request of the embodiment of the present invention includes a first query mode and a first query parameter; the first query model includes a first mode and a second mode; when the first query model is the first mode, the first query parameter is empty; when the first query model is the second mode, the first query parameter consists of one or more query container identifiers.
[0063] The test server 13 is further configured to receive a first container deletion request sent by the first client 2 ; and perform container deletion processing according to the first container deletion request and the test database 12 to obtain a corresponding first deletion result and send it back to the first client 2 .
[0064] Here, the first container deletion request of the embodiment of the present invention includes a first deletion mode and a first deletion parameter; the first deletion model includes a third mode and a fourth mode; when the first deletion model is the third mode, the first deletion parameter is empty; when the first deletion model is the fourth mode, the first deletion parameter consists of one or more deletion container identifiers; the first deletion result includes success and failure.
[0065] The test server 13 is also used to receive a first task creation request sent by the first client 2 ; and perform test task creation processing according to the first task creation request, the test resource library 11 and the test database 12 to obtain a corresponding second creation result and send it back to the first client 2 .
[0066] Here, the first task creation request in the embodiment of the present invention includes an allocation container identifier, a test task identifier, and a test image identifier; and the second creation result includes success and failure.
[0067] The test server 13 is also used to receive the first task query request sent by the first client 2 ; and perform test task query processing according to the first task query request and the test database 12 to obtain a corresponding second query result and send it back to the first client 2 .
[0068] Here, the first task query request of an embodiment of the present invention includes a second query mode and a second query parameter; the second query model includes a fifth mode and a sixth mode; when the second query model is the fifth mode, the second query parameter is empty; when the second query model is the sixth mode, the second query parameter consists of one or more query task identifiers.
[0069] The test server 13 is also used to regularly update the container status and task information.
[0070] In a specific implementation of the embodiment of the present invention, the test server 13 is specifically configured to, when performing container creation processing according to the first container creation request and the test database 12 to obtain a corresponding first creation result and sending it back to the first client 2:
[0071] Step A1, extracting the corresponding new container identifier, the IP address of the target under test, the CyberRT communication domain identifier of the target under test, the configuration description of the target under test, the login account number of the target under test, and the login password of the target under test from the first container creation request as the corresponding current container identifier, current IP address, current communication domain identifier, current configuration description, current login account number, and current login password;
[0072] Step A2, and take the first container monitoring record in the container monitoring information table of the test database 12, whose first container identifier matches the current container identifier and whose first container status is not deleted, as the corresponding current monitoring record; and identify whether the current monitoring record is empty; if not, set the corresponding first creation result to failure, and go to step A4; if yes, go to step A3;
[0073] Step A3, adding a first container monitoring record in the container monitoring information table as the corresponding current newly added record; and setting the first container identifier, the first measured target IP address, the first measured target CyberRT communication domain identifier, the first measured target configuration description, the first measured target login account and the first measured target login password of the current newly added record to the corresponding current container identifier, current IP address, current communication domain identifier, current configuration description, current login account and current login password; and setting the first assigned task identifier of the current newly added record to empty; and setting the first container status of the current newly added record to creation; and setting the corresponding first creation result to success;
[0074] Step A4: sending the first creation result obtained this time back to the first client 2.
[0075] It should be noted that, in order to improve the use efficiency of the test container pool 14, the embodiment of the present invention does not immediately build a real test container 141 in the test container pool 14 when processing a first container creation request, but only adds a management record, namely, a first container monitoring record, to the container monitoring information table, and sets the corresponding first container status to creation; it can be seen from the following that only when the first container identifier of the first container monitoring record is called by a first task creation request, a real test container 141 will be built in the test container pool 14 and the corresponding first container status will be set to running.
[0076] In another specific implementation of the embodiment of the present invention, the test server 13 is specifically configured to, when performing container query processing according to the first container query request and the test database 12 to obtain a corresponding first query result and sending it back to the first client 2:
[0077] Step B1, extracting a corresponding first query mode and a first query parameter from a first container query request as a corresponding current query mode and a current query parameter;
[0078] Step B2: if the current query mode is the first mode, the container monitoring information table of the test database 12 is used as the corresponding first query result;
[0079] Step B3, if the current query mode is the second mode, extract the first container monitoring records whose first container identifiers in the container monitoring information table match the query container identifiers of the current query parameters as corresponding first query records; and form the corresponding first query result from all the first query records obtained this time;
[0080] Step B4: sending the first query result obtained this time back to the first client 2.
[0081] In another specific implementation of the embodiment of the present invention, the test server 13 is specifically configured to, when performing container deletion processing according to the first container deletion request and the test database 12 to obtain a corresponding first deletion result and sending it back to the first client 2:
[0082] Step C1, extracting a corresponding first deletion mode and a first deletion parameter from the first container deletion request as the corresponding current deletion mode and current deletion parameter;
[0083] Step C2, if the current deletion mode is the third mode, the first container status of all first container monitoring records in the container monitoring information table of the test database 12 is set to be deleted; and all test containers 141 in the test container pool 14 are deleted; if all container statuses and containers are successfully deleted, the corresponding first deletion result is set to success; if some container statuses or some containers are not successfully deleted, the corresponding first deletion result is set to failure;
[0084] Step C3, if the current deletion mode is the fourth mode, the first container monitoring record whose first container identifier in the container monitoring information table matches each deletion container identifier of the current deletion parameter is recorded as the corresponding first deletion record; and the first container status of all first deletion records is set to deletion; and the test container 141 corresponding to all first deletion records in the test container pool 14 is deleted; if the container status of all first deletion records and the corresponding containers are successfully deleted, the corresponding first deletion result is set to success; if the container status of some first deletion records or the corresponding containers are not successfully deleted, the corresponding first deletion result is set to failure;
[0085] Step C4, sending the first deletion result obtained this time back to the first client 2.
[0086] In another specific implementation of the embodiment of the present invention, the test server 13 is specifically configured to, when performing test task creation processing according to the first task creation request, the test resource library 11 and the test database 12 to obtain a corresponding second creation result and send it back to the first client 2:
[0087] Step D1, extracting the corresponding allocated container identifier, test task identifier and test image identifier from the first task creation request as the corresponding current container identifier, current test task identifier and current test image identifier;
[0088] Step D2, and take the first container monitoring record in which the first container identifier in the container monitoring information table of the test database 12 matches the current container identifier and the first container status is created as the corresponding current monitoring record; and identify whether the current monitoring record is empty; if so, set the corresponding second creation result to failure, and go to step D6; if not, go to step D3;
[0089] Step D3, taking the first test task record whose first test task identifier in the test task information table matches the current test task identifier as the corresponding current task record; and identifying whether the current monitoring record is empty; if not, setting the corresponding second creation result to failure, and going to step D6; if so, going to step D4;
[0090] Step D4, setting the first assigned task identifier of the current monitoring record in the container monitoring information table to the corresponding current test task identifier; and adding a first test task record in the test task information table as the corresponding current newly added record; and setting the first test task identifier and the first test image identifier of the current newly added record to the corresponding current test task identifier and the current test image identifier; and setting the first test report of the current newly added record to empty;
[0091] Step D5, and use the first test image in the test resource library 11 that matches the first image identifier and the current test image identifier as the corresponding current test image; and use the first test main program path and the first test main program file name corresponding to the current test image as the corresponding current test main program path and the current test main program file name; and use the first measured target IP address, the first measured target CyberRT communication domain identifier, the first measured target login account and the first measured target login password of the current monitoring record as the corresponding current IP address, the current communication domain identifier, the current login account and the current login password; and use the first measured person 3 whose IP address matches the current IP address and whose CyberRT communication domain matches the current communication domain identifier as the corresponding current measured person ; and create a corresponding test container 141 for the current test image in the test container pool 14 and record it as the current test container; and establish a remote control channel with the current subject through the SSH channel connection method based on the current login account and the current login password in the operating environment of the current test container and record it as the corresponding current channel; and in the operating environment of the current test container, start and run the test main program corresponding to the current test main program path and the current test main program file name, and the currently running test main program tests the current subject through the current channel based on the built-in test process of the program; and when the test main program starts running, set the first container state of the current monitoring record in the container monitoring information table to running; and set the corresponding second creation result to success;
[0092] It should be noted here that, as mentioned above, when processing the first container creation request, a real test container 141 will not be immediately constructed in the test container pool 14. Only when the first container identifier of the first container monitoring record is called by a first task creation request, a real test container 141 will be constructed in the test container pool 14. The construction step of this real container is the processing step of constructing the current test container in the current step D5, that is, creating a corresponding test container 141 for the current test image in the test container pool 14 and recording it as the current test container; and this construction process is consistent with the conventional processing process of constructing a container instance based on an image. In short, the test container pool 14 creates a corresponding container instance for the current test image through easy management rules, and assembles the test environment for the container instance based on the test environment installation configuration program or batch file of the current test image;
[0093] Step D6, sending the second creation result obtained this time back to the first client 2.
[0094] In another specific implementation of the embodiment of the present invention, the test server 13 is specifically configured to, when performing test task query processing according to the first task query request and the test database 12 to obtain a corresponding second query result and sending it back to the first client 2:
[0095] Step E1, extracting the corresponding second query mode and second query parameter from the first task query request as the corresponding current query mode and current query parameter;
[0096] Step E2, if the current query mode is the fifth mode, the test task information table of the test database 12 is used as the corresponding second query result;
[0097] Step E3, if the current query mode is the sixth mode, the first test task record that matches the first test task identifier of the test task information table with each query task identifier of the current query parameter is recorded as the corresponding second query record; and all the obtained second query records form the corresponding second query result;
[0098] Step E4: sending the second query result obtained this time back to the first client 2.
[0099] In another specific implementation of the embodiment of the present invention, the test server 13 is specifically used to periodically traverse all test containers 141 of the test container pool 14 at a preset first time frequency when periodically performing container status and task information update processing; and in this round of traversal, the currently traversed test container 141 is used as the corresponding current container; and the first container monitoring record corresponding to the current container in the container monitoring information table of the test database 12 is used as the corresponding current monitoring record; and the first test task record in the test task information table of the test database 12 that matches the first assigned task identifier of the current monitoring record is used as the corresponding current task record record; and use the first test image whose first image identifier in the test resource library 11 matches the first test image identifier of the current task record as the corresponding current test image; and use the first test report storage path and the first report file name of the current test image as the corresponding current test report storage path and the current report file name; and identify whether a file with a file name matching the current report file name is stored in the storage location of the current test report storage path under the running environment of the current test container, and if so, set the first container state of the current monitoring record of the container monitoring information table to stop and set the first test report of the current task record of the test task information table to the corresponding current test report.
[0100] (IV) Test container pool 14:
[0101] The test container pool 14 according to the embodiment of the present invention includes a plurality of test containers 141 .
[0102] It should be noted that the test container pool 14 of the embodiment of the present invention is a container management environment for storing, managing and executing multiple test containers 141, which can be constructed by one or more servers, systems, platforms and / or computing node clusters. In this environment, each test container 141 is created based on a corresponding first test image.
[0103] It should also be noted that the division of the various system components / modules of the above system can be regarded as a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. And these system components / modules can all be implemented in the form of software calling through processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software calling through processing elements, and some modules can be implemented in the form of hardware. For example, the test server can be a separately established processing element, or it can be integrated in a chip of the above system. In addition, it can also be stored in the memory of the above system in the form of program code, and called and executed by a processing element of the above system. The implementation of other system components / modules is similar. In addition, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element described here can be an integrated circuit with signal processing capabilities. In the implementation process, the processing steps of each module of the aforementioned system can be completed by the hardware integrated logic circuit in the processor element or the instructions in the form of software.
[0104] For example, the system components / modules of the above system may be one or more integrated circuits configured to implement the functions of the corresponding components / modules, such as: one or more application specific integrated circuits (ASIC), or one or more digital signal processors (DSP), or one or more field programmable gate arrays (FPGA). For another example, when a system component / module of the above system is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0105] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in accordance with the aforementioned system is generated in whole or in part. The above computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The above computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the above computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (Digital Subscriber Line, DSL)) or wireless (e.g., infrared, wireless, Bluetooth, microwave, etc.) mode to another website site, computer, server or data center. The above computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, data center, etc. that includes one or more available media integrated. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium (eg, a solid state disk (SSD)).
[0106] The embodiment of the present invention provides a test management system; as can be seen from the above content, the system includes: a test resource library, a test database, a test server and a test container pool; the test resource library is used to store multiple first test images; the test database is used to store a container monitoring information table and a test task information table; the test server is used to process container creation / query / deletion tasks, and is also used to process test task creation / query tasks, and is also used to monitor / update container status and task information. The embodiment of the present invention introduces container technology to build a test environment and process test tasks, which not only reduces the difficulty of setting up a test environment, reduces the workload of setting up a test environment, but also improves test consistency.
[0107] The professionals should further realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to the function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0108] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0109] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A test management system, characterized in that: The system includes: a test resource library, a test database, a test server and a test container pool; The test server is connected to the test resource library, the test database and the test container pool respectively; the test server is also connected to a first client outside the system; each test container in the test container pool is connected to a first testee outside the system respectively; the first testee is a carrier device, host, virtual machine, server, system or platform of a type of tested service; the tested service interfaces of all the first testees are the same, but the software / hardware resource configurations are different; The test resource library is used to store multiple first test images; The test database is used to store the container monitoring information table and the test task information table; The test server is used to receive a first container creation request sent by the first client; and perform container creation processing according to the first container creation request and the test database to obtain a corresponding first creation result and send it back to the first client; the first container creation request includes a new container identifier, a tested target IP address, a tested target CyberRT communication domain identifier, a tested target configuration description, a tested target login account, and a tested target login password; the first creation result includes success and failure; The test server is also used to receive a first container query request sent by the first client; and perform container query processing according to the first container query request and the test database to obtain a corresponding first query result and send it back to the first client; the first container query request includes a first query mode and a first query parameter; the first query model includes a first mode and a second mode; when the first query model is the first mode, the first query parameter is empty; when the first query model is the second mode, the first query parameter consists of one or more query container identifiers; The test server is also used to receive a first container deletion request sent by the first client; and perform container deletion processing according to the first container deletion request and the test database to obtain a corresponding first deletion result and send it back to the first client; the first container deletion request includes a first deletion mode and a first deletion parameter; the first deletion model includes a third mode and a fourth mode; when the first deletion model is the third mode, the first deletion parameter is empty; when the first deletion model is the fourth mode, the first deletion parameter consists of one or more deletion container identifiers; the first deletion result includes success and failure; The test server is also used to receive a first task creation request sent by the first client; and perform test task creation processing according to the first task creation request, the test resource library and the test database to obtain a corresponding second creation result and send it back to the first client; the first task creation request includes an allocation container identifier, a test task identifier and a test image identifier; the second creation result includes success and failure; The test server is also used to receive a first task query request sent by the first client; and perform test task query processing according to the first task query request and the test database to obtain a corresponding second query result and send it back to the first client; the first task query request includes a second query mode and a second query parameter; the second query model includes a fifth mode and a sixth mode; when the second query model is the fifth mode, the second query parameter is empty; when the second query model is the sixth mode, the second query parameter consists of one or more query task identifiers; The test server is also used to regularly update container status and task information.
2. The test management system according to claim 1, characterized in that: Each of the first test images corresponds to a set of image configuration parameters, wherein the image configuration parameters at least include a first image identifier, a first image name, a first image version, a first test main program path, a first test report storage path, a first test main program file name, and a first report file name; the first image identifier is a unique identifier of the current test image; the first image name and the first image version are the name and version of the current test image; The first test main program path is the storage location of the test main program of the current test image in the current image environment; the first test report storage path is the storage location of the test report output by the test main program of the current test image in the current image environment; the first test main program file name is the file name of the test main program of the current test image; the first report file name is the file name of the test report output by the test main program of the current test image; The container monitoring information table includes a plurality of first container monitoring records; the first container monitoring record corresponds to one of the test containers; the first container monitoring record includes a first container identifier, a first measured target IP address, a first measured target Cyber RT communication domain identifier, a first measured target configuration description, a first measured target login account, a first measured target login password, a first assigned task identifier, and a first container status; the first container identifier is a unique identifier of the current test container; The first tested target IP address is the IP address of the first tested person corresponding to the current test container; The Cyber RT communication domain identifier of the first measured target is the Cyber RT communication domain identifier of the first measured person corresponding to the current test container; the configuration description of the first measured target is the software / hardware resource configuration description of the first measured person corresponding to the current test container; the login account of the first measured target and the login password of the first measured target are the SSH channel login user name and password of the first measured person corresponding to the current test container; the first assigned task identifier is the test task identifier assigned to the current test container; the first container status includes creation, running, stop and deletion; The test task information table includes a plurality of first test task records; the first test task records correspond to the test tasks one by one; the first test task records include a first test task identifier, a first test image identifier and a first test report; The first test task identifier is a unique identifier of the current test task; the first test image identifier is the first image identifier of the first test image corresponding to the current test task; The first test report is a test report corresponding to the current test task. When the current test task is not completed, the first test report is empty.
3. The test management system according to claim 2, characterized in that: The test server is specifically configured to, when the container creation process is performed according to the first container creation request and the test database to obtain a corresponding first creation result and send it back to the first client: Step 31, extracting the corresponding new container identifier, the measured target IP address, the measured target Cyber RT communication domain identifier, the measured target configuration description, the measured target login account and the measured target login password from the first container creation request as the corresponding current container identifier, current IP address, current communication domain identifier, current configuration description, current login account and current login password; Step 32, and taking the first container monitoring record in the container monitoring information table of the test database whose first container identifier matches the current container identifier and whose first container status is not deleted as the corresponding current monitoring record; and identifying whether the current monitoring record is empty; if not, setting the corresponding first creation result to failure, and going to step 34; If yes, go to step 33; Step 33, adding a new first container monitoring record in the container monitoring information table as the corresponding current newly added record; and setting the first container identifier, the first measured target IP address, the first measured target Cyber RT communication domain identifier, the first measured target configuration description, the first measured target login account and the first measured target login password of the current newly added record to the corresponding current container identifier, the current IP address, the current communication domain identifier, the current configuration description, the current login account and the current login password; and setting the first assigned task identifier of the current newly added record to empty; and setting the first container status of the current newly added record to creation; and setting the corresponding first creation result to success; Step 34: Send the first creation result obtained this time back to the first client.
4. The test management system according to claim 2, characterized in that: The test server is specifically configured to, when performing container query processing according to the first container query request and the test database to obtain a corresponding first query result and sending it back to the first client: Step 41: extracting the first query mode and the first query parameter corresponding to the first container query request as the corresponding current query mode and current query parameter; Step 42: if the current query mode is the first mode, taking the container monitoring information table of the test database as the corresponding first query result; Step 43: if the current query mode is the second mode, extracting the first container monitoring records in the container monitoring information table whose first container identifier matches each query container identifier of the current query parameter as corresponding first query records; All the first query records obtained this time form the corresponding first query result; Step 44: Send the first query result obtained this time back to the first client.
5. The test management system according to claim 2, characterized in that: The test server is specifically configured to, when performing container deletion processing according to the first container deletion request and the test database to obtain a corresponding first deletion result and sending it back to the first client: Step 51: extracting the first deletion mode and the first deletion parameter corresponding to the first container deletion request as the corresponding current deletion mode and current deletion parameter; Step 52: if the current deletion mode is the third mode, the first container status of all the first container monitoring records in the container monitoring information table of the test database are set to be deleted; and all the test containers in the test container pool are deleted; if all container statuses and containers are successfully deleted, the corresponding first deletion result is set to be successful; if some container statuses or some containers are not successfully deleted, the corresponding first deletion result is set to be failed; Step 53: if the current deletion mode is the fourth mode, the first container monitoring record in which the first container identifier in the container monitoring information table matches each of the deletion container identifiers of the current deletion parameter is recorded as a corresponding first deletion record; and the first container status of all the first deletion records is set to deletion; and the test containers corresponding to all the first deletion records in the test container pool are deleted; if the container status of all the first deletion records and the corresponding containers are successfully deleted, the corresponding first deletion result is set to success; if the container status of some of the first deletion records or the corresponding containers are not successfully deleted, the corresponding first deletion result is set to failure; Step 54: Send the first deletion result obtained this time back to the first client.
6. The test management system according to claim 2, characterized in that: The test server is specifically configured to, when the test task creation process is performed according to the first task creation request, the test resource library and the test database to obtain a corresponding second creation result and send it back to the first client: Step 61, extracting the corresponding allocated container identifier, the test task identifier and the test image identifier from the first task creation request as the corresponding current container identifier, current test task identifier and current test image identifier; Step 62, and taking the first container monitoring record in the container monitoring information table of the test database in which the first container identifier matches the current container identifier and the first container status is created as the corresponding current monitoring record; and identifying whether the current monitoring record is empty; if so, setting the corresponding second creation result to failure, and going to step 66; If not, go to step 63; Step 63, taking the first test task record whose first test task identifier in the test task information table matches the current test task identifier as the corresponding current task record; and identifying whether the current monitoring record is empty; if not, setting the corresponding second creation result to failure, and going to step 66; If yes, go to step 64; Step 64, setting the first assigned task identifier of the current monitoring record in the container monitoring information table to the corresponding current test task identifier; And add a new first test task record in the test task information table as the corresponding current newly added record; and set the first test task identifier and the first test image identifier of the current newly added record to the corresponding current test task identifier and the current test image identifier; and set the first test report of the current newly added record to empty; Step 65, and taking the first test image in the test resource library whose first image identifier matches the current test image identifier as the corresponding current test image; And use the first test main program path and the first test main program file name corresponding to the current test image as the corresponding current test main program path and the current test main program file name; and use the first tested target IP address, the first tested target CyberRT communication domain identifier, the first tested target login account and the first tested target login password of the current monitoring record as the corresponding current IP address, current communication domain identifier, current login account and current login password; and use the first tested person whose IP address matches the current IP address and whose Cyber RT communication domain matches the current communication domain identifier as the corresponding current tested person; and create a corresponding test container for the current test image in the test container pool and record it as the current test container; And in the operating environment of the current test container, a remote control channel is established with the current test subject based on the current login account and the current login password through the SSH channel connection mode, and recorded as the corresponding current channel; and, in the running environment of the current test container, starting and running the test main program corresponding to the current test main program path and the current test main program file name, and having the currently running test main program test the current subject through the current channel based on the test flow built into the program; When the test main program starts running, the first container state of the current monitoring record in the container monitoring information table is set to running; and the corresponding second creation result is set to success; Step 66: Send the second creation result obtained this time back to the first client.
7. The test management system according to claim 2, characterized in that: The test server is specifically configured to, when the test task query processing is performed according to the first task query request and the test database to obtain a corresponding second query result and send it back to the first client: Step 71, extracting the corresponding second query mode and the second query parameter from the first task query request as the corresponding current query mode and current query parameter; Step 72: if the current query mode is the fifth mode, taking the test task information table of the test database as the corresponding second query result; Step 73: if the current query mode is the sixth mode, the first test task record that matches the first test task identifier of the test task information table with each of the query task identifiers of the current query parameter is recorded as a corresponding second query record; and forming the corresponding second query result from all the obtained second query records; Step 74: Send the second query result obtained this time back to the first client.
8. The test management system according to claim 2, characterized in that: The test server is specifically configured to periodically traverse all the test containers in the test container pool at a preset first time frequency during the periodic container status and task information update process; and during this round of traversal, use the currently traversed test container as the corresponding current container; And use the first container monitoring record corresponding to the current container in the container monitoring information table of the test database as the corresponding current monitoring record; and use the first test task record whose first test task identifier in the test task information table of the test database matches the first assigned task identifier of the current monitoring record as the corresponding current task record; and taking the first test image whose first image identifier in the test resource library matches the first test image identifier of the current task record as the corresponding current test image; And use the first test report storage path and the first report file name of the current test image as the corresponding current test report storage path and current report file name; and identify whether a file with a file name matching the current report file name is stored in the storage location of the current test report storage path in the running environment of the current test container. If so, set the first container status of the current monitoring record in the container monitoring information table to stop and set the first test report of the current task record in the test task information table to the corresponding current test report.