Mirror image warehouse testing method and device, equipment and medium
Through automated mirror warehouse testing methods, the mirror warehouse list is obtained and verified, and the test data and reports are generated, which solves the problem of low manual testing efficiency in the existing technology and realizes efficient automated testing.
Patent Information
- Application Number
- CN202311470406.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-07
- Publication Date
- 2025-05-13
AI Technical Summary
Existing mirror warehouse testing mainly relies on manual methods, resulting in low testing efficiency.
By obtaining the list of mirrored warehouses to be tested, verifying the mirrored warehouses that need to be tested, updating the test identifier, and generating test data and test reports based on the preset data, and automatically testing the mirrored warehouse.
No manual participation is required, which significantly improves the efficiency of mirror warehouse testing and generates detailed test reports for maintenance.
Smart Images

Figure CN119988202A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computers, and in particular to a method, device, equipment and medium for testing an image repository. Background Art
[0002] With the development of technology, containerization technology can be used to run applications on different operating systems and in different environments, avoiding incompatibility issues. The application and the data required for its operation are packaged into an independent container, which can then be deployed and run on different devices to run the application.
[0003] Containers exist in the form of container images, which are stored in container repositories. When a device needs to deploy a container, it pulls the container image from the image repository for deployment. In order to ensure that there are no problems with the image repository, it needs to be tested. In the prior art, manual testing is usually used to obtain a test report.
[0004] In summary, the existing image repository uses manual testing, resulting in low testing efficiency. Summary of the invention
[0005] The present application provides an image repository testing method, device, equipment and medium, which are used to solve the problem that the existing image repository adopts a manual method to perform testing, resulting in low testing efficiency.
[0006] In a first aspect, the present application provides an image repository testing method, comprising:
[0007] Obtain a list of image warehouses to be tested, wherein the list of image warehouses to be tested includes initial warehouse data corresponding to multiple image warehouses, wherein the initial warehouse data includes a warehouse address, login data, and a test identifier, wherein the test identifier is used to indicate that the image warehouse needs to be tested, or indicates that the test is not required;
[0008] For each test identifier indicating initial warehouse data to be tested, verify the image warehouse corresponding to the initial warehouse data according to the warehouse address in the initial warehouse data and the login data, and obtain a verification result corresponding to the image warehouse, wherein the verification result is used to indicate that the image warehouse verification has passed, or indicates that the image warehouse verification has failed;
[0009] According to the verification result, the test identifier in the initial warehouse data is updated to obtain the target warehouse data;
[0010] Generate configuration according to preset data and generate test data;
[0011] For each target warehouse data that needs to be tested indicated by a test identifier, the mirror warehouse corresponding to the target warehouse data is tested according to the test data and at least one preset test case, and a test report is generated.
[0012] Optionally, in the method as described above, verifying the image warehouse corresponding to the initial warehouse data according to the warehouse address in the initial warehouse data and the login data to obtain the verification result corresponding to the image warehouse includes:
[0013] Perform a login operation according to the warehouse address and the login data to determine whether the warehouse address is accessible;
[0014] If the warehouse address is accessible, generating a verification result indicating that the image warehouse verification has passed;
[0015] If the repository address is inaccessible, a verification result is generated indicating that the image repository verification has failed.
[0016] Optionally, in the method as described above, the test identifier in the initial warehouse data is updated according to the verification result to obtain the target warehouse data;
[0017] If the verification result indicates that the image repository verification has failed, updating the test flag to a flag indicating that no test is required;
[0018] If the verification result is used to indicate that the image repository verification has failed, the test flag is not updated.
[0019] Optionally, in the method described above, the test data includes at least one test image and at least one Chart package.
[0020] Optionally, in the method as described above, the at least one preset test case includes at least one of a test case for testing the warehouse address login status, a test case for testing the image upload status and download status, a test case for testing the Chart package upload status and download status, and a test case for testing concurrent downloads.
[0021] Optionally, in the method as described above, the step of testing the image repository corresponding to the target repository data according to the test data and at least one preset test case to generate a test report includes:
[0022] For each preset test case, according to the test data, run the preset test case to test the image repository, and generate a log corresponding to the preset test case;
[0023] Parse the logs corresponding to each preset test case and generate a test report.
[0024] Optionally, in the method described above, the test report includes a test result corresponding to each preset test case, and the test result is used to indicate that the image repository has passed the test under the test case, or indicates that the image repository has failed the test under the test case; if the test result indicates that the image repository has failed the test under the test case, the test report also includes the test failure reason information corresponding to the test case.
[0025] In a second aspect, the present application provides an image repository testing device, including:
[0026] An acquisition module is used to acquire a list of image warehouses to be tested, wherein the list of image warehouses to be tested includes initial warehouse data corresponding to multiple image warehouses, wherein the initial warehouse data includes a warehouse address, login data, and a test identifier, wherein the test identifier is used to indicate that the image warehouse needs to be tested, or indicates that the test is not required;
[0027] A verification module, for each test identifier indicating initial warehouse data to be tested, based on the warehouse address in the initial warehouse data and the login data, verifying the image warehouse corresponding to the initial warehouse data, and obtaining a verification result corresponding to the image warehouse, wherein the verification result is used to indicate that the image warehouse verification has passed, or indicates that the image warehouse verification has failed;
[0028] Processing modules for:
[0029] According to the verification result, the test identifier in the initial warehouse data is updated to obtain the target warehouse data;
[0030] Generate configuration according to preset data and generate test data;
[0031] The test module is used to test the image repository corresponding to each target repository data that needs to be tested according to each test identifier and at least one preset test case, and generate a test report.
[0032] In a third aspect, the present application provides an electronic device, including:
[0033] Processor, memory, communication interface;
[0034] The memory is used to store executable instructions of the processor;
[0035] The processor is configured to execute the image repository testing method according to any one of the first aspects by executing the executable instructions.
[0036] In a fourth aspect, the present application provides a readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the image repository testing method described in any one of the first aspects is implemented.
[0037] The image warehouse testing method, device, equipment and medium provided in the present application, after obtaining the list of image warehouses to be tested, verifies the image warehouses whose test identifiers indicate that they need to be tested, and then tests the image warehouses that have passed the verification. During the test, the test is performed according to the test data and preset test cases, and a test report is generated after the test is completed. This solution verifies the image warehouse, and tests the image warehouse that has passed the verification according to the test data and preset test cases, without the need for manual testing, which effectively improves the testing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0039] Figure 1a A flowchart of the first embodiment of the image repository testing method provided by this application;
[0040] Figure 1b A schematic diagram of the server provided for this application testing the image repository;
[0041] Figure 2 A flowchart of the second embodiment of the image repository testing method provided in this application;
[0042] Figure 3 A flowchart of the third embodiment of the image repository testing method provided in this application;
[0043] Figure 4 A schematic diagram of the structure of an embodiment of the image repository testing device provided by the present application;
[0044] Figure 5 A schematic diagram of the structure of an electronic device provided in this application.
[0045] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0046] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0047] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0048] With the development of science and technology, containerization technology has been applied in various fields. Containerization technology can package applications and the data required for their operation into an independent container, which can then be run and deployed on different devices to realize the operation of the application.
[0049] Containers exist in the form of container images, which are stored in container repositories. When a device needs to deploy a container, it pulls the container image from the image repository for deployment. In order to ensure that there are no problems with the image repository, it needs to be tested. In the prior art, manual testing is usually used to obtain a test report. The use of manual testing will lead to low test efficiency.
[0050] In view of the problems existing in the prior art, the inventors discovered during the study of the image warehouse testing method that in order to improve the testing efficiency, multiple image warehouses are tested in one testing process, and test cases and test data are used for testing during the testing process. After obtaining the list of image warehouses to be tested, the image warehouses indicated by the test identifiers that need to be tested are verified, and then the image warehouses that have passed the verification are tested. During the test, the test is performed according to the test data and the preset test cases, and a test report is generated after the test is completed, which can effectively improve the testing efficiency. Based on the above-mentioned inventive concept, the image warehouse testing scheme in this application is designed.
[0051] The execution subject of the image repository testing method in this application can be a computer, a server, a terminal device, etc. This application does not limit it. The following description will be given using a server as an example.
[0052] The following is an example of an application scenario of the image repository testing method provided in this application.
[0053] For example, in this application scenario, multiple business devices form a business cluster, and the business devices in the business cluster are required to run the application. To facilitate deployment, the business device can pull the image corresponding to the application from the image warehouse, and then deploy and run it. In order to ensure that the business device can successfully pull the image, the image warehouse needs to be tested before pulling the image.
[0054] During the test, multiple image repositories can be tested. The tester uses the terminal device to send the list of image repositories to be tested to the server, and the server can obtain the list of image repositories to be tested, which includes the initial warehouse data corresponding to multiple image repositories, including the warehouse address, login data, and test identification.
[0055] For each test identifier indicating the initial warehouse data that needs to be tested, the mirror warehouse corresponding to the initial warehouse data is verified according to the warehouse address and login data in the initial warehouse data to obtain a verification result corresponding to the mirror warehouse.
[0056] Then, based on the verification result, the test identifier in the initial warehouse data is updated to obtain the target warehouse data.
[0057] Then generate configuration according to preset data and generate test data; then for each test identifier indicating the target warehouse data that needs to be tested, test the mirror warehouse corresponding to the target warehouse data according to the test data and at least one preset test case, and generate a test report.
[0058] After the server sends the test report to the terminal device for display, the tester can determine whether there is a problem with the image repository based on the test report. If there is a problem, the image repository can be repaired and tested again. If there is no problem, the process of pulling from the image repository can be carried out.
[0059] It should be noted that the above scenario is only an example of an application scenario provided by an embodiment of the present application. The embodiment of the present application does not limit the actual form of the various devices included in the scenario, nor does it limit the interaction method between the devices. In the specific application of the solution, it can be set according to actual needs.
[0060] The technical solution of the present application is described in detail below through specific embodiments. It should be noted that the following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0061] Figure 1a This is a flow chart of the first embodiment of the image repository testing method provided by the present application. After the server obtains the list of image repositories to be tested, the image repositories that need to be tested are verified, and then the image repositories that have passed the verification are tested using test cases to generate a test report. The method in this embodiment can be implemented by software, hardware, or a combination of software and hardware. Figure 1a As shown, the image warehouse testing method specifically includes the following steps:
[0062] S101: Obtain a list of image repositories to be tested.
[0063] When multiple image repositories need to be tested, the tester can use the terminal device to generate a list of repositories to be tested. The list of image repositories to be tested includes the initial repository data corresponding to the multiple image repositories. The initial repository data includes the repository address, login data, and a test identifier. The test identifier is used to indicate that the image repository needs to be tested, or does not need to be tested.
[0064] Then deploy the test tool in the server, and the server runs the test tool to complete the test. The tester uses the terminal device to send the generated list of image repositories to be tested to the server, and the server can obtain the list of image repositories to be tested.
[0065] It should be noted that for generating the list of image warehouses to be tested, in the Kubernetes environment, the file name of the generated list of image warehouses to be tested can be used as the key in the configmap, and the content of the list of image warehouses to be tested can be used as the value of the configmap, and it can be mounted to the directory corresponding to the container when deploying the test tool. In other environments, such as the Docker environment and the Linux environment, the file of the list of image warehouses to be tested can be directly generated.
[0066] S102: For each initial warehouse data that needs to be tested indicated by the test identifier, verify the mirror warehouse corresponding to the initial warehouse data according to the warehouse address and login data in the initial warehouse data to obtain a verification result corresponding to the mirror warehouse.
[0067] In this step, after the server obtains the list of image repositories to be tested, for each test identifier indicating the initial warehouse data that needs to be tested, the image repository corresponding to the initial warehouse data is verified according to the warehouse address and login data in the initial warehouse data to detect whether the warehouse address is accessible, and obtain the verification result corresponding to the image repository.
[0068] The verification result is used to indicate that the image repository verification has passed, or to indicate that the image repository verification has failed.
[0069] S103: According to the verification result, the test identifier in the initial warehouse data is updated to obtain the target warehouse data.
[0070] In this step, after obtaining the verification result, the server updates the test identifier in the initial warehouse data according to the verification result to obtain the target warehouse data.
[0071] Specifically, if the verification result indicates that the image repository verification has not passed, the test flag is updated to indicate that the test does not need to be performed; if the verification result indicates that the image repository verification has not passed, the test flag is not updated.
[0072] S104: Generate configuration according to preset data and generate test data.
[0073] In this step, after the server obtains the list of image repositories to be tested, it also needs to generate configurations based on preset data and generate test data.
[0074] The preset data generation configuration includes Dockerfile and multiple versions of helm tools. Dockerfile is used to build a test image, which can be a large image or a multi-layer image. The helm tool is used to generate a Chart package. Therefore, the preset data generation configuration can be used to generate test data. The test data includes at least one test image and at least one Chart package.
[0075] It should be noted that the execution order of step S102-step S103 and step S104 can be: first execute step S102-step S103, then execute step S104; it can also be: first execute step S104, then execute step S102-step S103; it can also be: step S102-step S103 and step S104 are executed simultaneously. The embodiment of the present application does not limit the execution order of step S102-step S103 and step S104, which can be determined according to actual conditions.
[0076] S105: For each target warehouse data indicated by the test identifier to be tested, the mirror warehouse corresponding to the target warehouse data is tested according to the test data and at least one preset test case, and a test report is generated.
[0077] In this step, after obtaining the target warehouse data and the test data, for each target warehouse data that needs to be tested as indicated by the test identifier, the server tests the mirror warehouse corresponding to the target warehouse data according to the test data and at least one preset test case, and generates a test report.
[0078] It should be noted that at least one preset test case includes at least one of a test case for testing the warehouse address login status, a test case for testing the test image upload status and download status, a test case for testing the Chart package upload status and download status, and a test case for testing concurrent downloads. The present application embodiment does not limit the preset test cases and can be set according to actual conditions.
[0079] For example, Figure 1b The schematic diagram of the server provided for this application testing the image repository is as follows: Figure 1b As shown, the business cluster includes multiple business servers for business processing, and there is a test server in the business server, and the test server is used to test the image warehouse. The test server uses test data and preset test cases to test multiple image warehouses and generate a test report.
[0080] The image warehouse testing method provided in this embodiment obtains the list of image warehouses to be tested, verifies the image warehouses indicated by the test identifiers that need to be tested, and then tests the image warehouses that have passed the verification. During the test, the test is performed according to the test data and the preset test cases, and a test report is generated after the test is completed. Compared with the manual testing in the prior art, this solution verifies the image warehouse, and tests the image warehouse that has passed the verification according to the test data and the preset test cases, without the need for manual testing, which effectively improves the testing efficiency. In addition, this solution is also compatible with multiple image warehouse types, which improves the test compatibility.
[0081] Figure 2 This is a flow chart of the second embodiment of the image repository testing method provided by the present application. Based on the above embodiment, the present embodiment of the present application describes the situation where the server verifies the image repository. Figure 2 As shown, the image warehouse testing method specifically includes the following steps:
[0082] S201: Perform a login operation based on the warehouse address and login data to determine whether the warehouse address is accessible; if the warehouse address is accessible, execute step S202; if the warehouse address is not accessible, execute step S203.
[0083] In this step, after the server obtains the list of image repositories to be tested, it verifies the initial repository data that needs to be tested indicated by each test identifier, and performs a login operation based on the repository address and login data to determine whether the repository address is accessible.
[0084] It should be noted that the login data includes a user name and a password.
[0085] S202: Generate a verification result indicating that the image repository verification has passed.
[0086] In this step, if the server determines that the warehouse address is accessible, indicating that the verification is passed, a verification result is generated to indicate that the image warehouse verification is passed.
[0087] S203: Generate a verification result indicating that the image repository verification has failed.
[0088] In this step, if the server determines that the repository address is inaccessible, indicating that the verification has failed, a verification result indicating that the image repository verification has failed is generated.
[0089] It should be noted that if there are multiple warehouse addresses of an image repository, each warehouse address will be verified in turn according to the login data until one warehouse address is accessible, or until all warehouse addresses are inaccessible; until one warehouse address is accessible, a verification result indicating that the image repository verification has passed is generated; until all warehouse addresses are inaccessible, a verification result indicating that the image repository verification has failed is generated.
[0090] The image repository testing method provided in this embodiment verifies the image repository by determining whether the repository address is available, so that the verification result is more accurate.
[0091] Figure 3 This is a flow chart of the third embodiment of the image repository testing method provided by the present application. Based on the above embodiment, the present embodiment of the present application describes the situation where the server tests the image repository. Figure 3 As shown, the image warehouse testing method specifically includes the following steps:
[0092] S301: For each preset test case, run the preset test case to test the image repository according to the test data, and generate a log corresponding to the preset test case.
[0093] In this step, after the server obtains the test data, it can test the image warehouse corresponding to the target warehouse data that needs to be tested indicated by each test identifier. Since there is at least one preset test case, for each preset test case, the preset test case can be run according to the test data to test the image warehouse and generate a log corresponding to the preset test case.
[0094] The server uses the repository address of the image repository as the image tag of the test image in the test data, and then uses the test data to run the preset test cases and generate logs.
[0095] It should be noted that if there are multiple warehouse addresses for an image warehouse, when verifying the image warehouse, the warehouse address of the image warehouse that has passed the verification will be determined, and then the warehouse address will be used as the image label of the test image in the test data.
[0096] It should be noted that if the initial warehouse data also includes a sub-warehouse name, the sub-warehouse name of the image warehouse is added to the image tag of the test image in the test data.
[0097] S302: Analyze the log corresponding to each preset test case and generate a test report.
[0098] In this step, after obtaining the log corresponding to each preset test case, the server parses the log corresponding to each preset test case and generates a test report corresponding to the image repository.
[0099] The test report includes the test results corresponding to each preset test case. The test results are used to indicate that the image repository has passed the test under the test case, or indicate that the image repository has failed the test under the test case; if the test result indicates that the image repository has failed the test under the test case, the test report also includes the reason information for the test failure corresponding to the test case.
[0100] The log corresponding to each preset test case is parsed to obtain the keyword therein. If the keyword is the first preset keyword, a test result corresponding to the test case is generated. At this time, the test result indicates that the image repository has failed the test under the test case. Then, the reason information in the log is identified to obtain the reason information of the test failure corresponding to the test case.
[0101] If the keyword is the second preset keyword, a test result corresponding to the test case is generated. In this case, the test result indicates that the image repository has passed the test under the test case.
[0102] It should be noted that the first keyword is used to indicate that the test failed, and the second keyword is used to indicate that the test passed. The first keyword can be fail, error, fault, etc., and the second keyword can be succeed, correct, pass, etc. The embodiment of the present application does not limit the first keyword and the second keyword, which can be determined according to actual conditions.
[0103] The image repository testing method provided in this embodiment tests the image repository according to each preset test case, and then obtains a test report according to the generated log, so that the test report is more accurate.
[0104] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0105] Figure 4 This is a schematic diagram of the structure of an embodiment of the image repository testing device provided by this application. Figure 4 As shown, the image warehouse testing device 40 includes:
[0106] An acquisition module 41 is used to acquire a list of image warehouses to be tested, wherein the list of image warehouses to be tested includes initial warehouse data corresponding to multiple image warehouses, wherein the initial warehouse data includes a warehouse address, login data, and a test identifier, wherein the test identifier is used to indicate that the image warehouse needs to be tested, or indicates that the test is not required;
[0107] A verification module 42 is used for verifying the image warehouse corresponding to each initial warehouse data to be tested according to the warehouse address in the initial warehouse data and the login data for each test identifier, and obtaining a verification result corresponding to the image warehouse, wherein the verification result is used to indicate that the image warehouse verification has passed, or indicates that the image warehouse verification has failed;
[0108] The processing module 43 is used for:
[0109] According to the verification result, the test identifier in the initial warehouse data is updated to obtain the target warehouse data;
[0110] Generate configuration according to preset data and generate test data;
[0111] The testing module 44 is used to test the image repository corresponding to each target repository data that needs to be tested according to each test identifier and at least one preset test case, and generate a test report.
[0112] Furthermore, the verification module 42 is specifically used for:
[0113] Perform a login operation according to the warehouse address and the login data to determine whether the warehouse address is accessible;
[0114] If the warehouse address is accessible, generating a verification result indicating that the image warehouse verification has passed;
[0115] If the repository address is inaccessible, a verification result is generated indicating that the image repository verification has failed.
[0116] Furthermore, the processing module 43 is specifically used for:
[0117] If the verification result indicates that the image repository verification has failed, updating the test flag to a flag indicating that no test is required;
[0118] If the verification result is used to indicate that the image repository verification has failed, the test flag is not updated.
[0119] Furthermore, the test data includes at least one test image and at least one Chart package.
[0120] Furthermore, the at least one preset test case includes at least one of a test case for testing the warehouse address login status, a test case for testing the image upload status and download status, a test case for testing the Chart package upload status and download status, and a test case for testing concurrent downloads.
[0121] Furthermore, the testing module 44 is specifically used for:
[0122] For each preset test case, according to the test data, run the preset test case to test the image repository, and generate a log corresponding to the preset test case;
[0123] Parse the logs corresponding to each preset test case and generate a test report.
[0124] Furthermore, the test report includes a test result corresponding to each preset test case, and the test result is used to indicate that the image repository has passed the test under the test case, or indicates that the image repository has failed the test under the test case; if the test result indicates that the image repository has failed the test under the test case, the test report also includes the test failure reason information corresponding to the test case.
[0125] The image repository testing device provided in this embodiment is used to execute the technical solution in any of the aforementioned method embodiments. Its implementation principle and technical effects are similar and will not be described in detail here.
[0126] Figure 5 This is a schematic diagram of the structure of an electronic device provided in this application. Figure 5 As shown, the electronic device 50 includes:
[0127] Processor 51, memory 52, and communication interface 53;
[0128] The memory 52 is used to store executable instructions of the processor 51;
[0129] The processor 51 is configured to execute the technical solution in any of the aforementioned method embodiments by executing the executable instructions.
[0130] Optionally, the memory 52 may be independent or integrated with the processor 51 .
[0131] Optionally, when the memory 52 is a device independent of the processor 51, the electronic device 50 may further include:
[0132] The bus 54 , the memory 52 and the communication interface 53 are connected to the processor 51 via the bus 54 and communicate with each other. The communication interface 53 is used to communicate with other devices.
[0133] Optionally, the communication interface 53 may be implemented by a transceiver. The communication interface is used to implement communication between the database access device and other devices (such as a client, a read-write library, and a read-only library). The memory may include a random access memory (RAM) and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage.
[0134] The bus 54 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0135] The above-mentioned processor can be a general-purpose processor, including a central processing unit CPU, a network processor (NP), etc.; it can also be a digital signal processor DSP, an application-specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0136] The electronic device is used to execute the technical solution in any of the aforementioned method embodiments, and its implementation principle and technical effect are similar and will not be repeated here.
[0137] An embodiment of the present application also provides a readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the technical solution provided by any of the aforementioned method embodiments is implemented.
[0138] An embodiment of the present application also provides a computer program product, including a computer program, which is used to implement the technical solution provided by any of the aforementioned method embodiments when executed by a processor.
[0139] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0140] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A mirror repository testing method, characterized in that: include: Obtain a list of image warehouses to be tested, wherein the list of image warehouses to be tested includes initial warehouse data corresponding to multiple image warehouses, wherein the initial warehouse data includes a warehouse address, login data, and a test identifier, wherein the test identifier is used to indicate that the image warehouse needs to be tested, or indicates that the test is not required; For each test identifier indicating initial warehouse data to be tested, verify the image warehouse corresponding to the initial warehouse data according to the warehouse address in the initial warehouse data and the login data, and obtain a verification result corresponding to the image warehouse, wherein the verification result is used to indicate that the image warehouse verification has passed, or indicates that the image warehouse verification has failed; According to the verification result, the test identifier in the initial warehouse data is updated to obtain the target warehouse data; Generate configuration according to preset data and generate test data; For each target warehouse data that needs to be tested indicated by a test identifier, the mirror warehouse corresponding to the target warehouse data is tested according to the test data and at least one preset test case, and a test report is generated.
2. The method according to claim 1, characterized in that The verifying the image warehouse corresponding to the initial warehouse data according to the warehouse address in the initial warehouse data and the login data to obtain the verification result corresponding to the image warehouse includes: Perform a login operation according to the warehouse address and the login data to determine whether the warehouse address is accessible; If the warehouse address is accessible, generating a verification result indicating that the image warehouse verification has passed; If the repository address is inaccessible, a verification result is generated indicating that the image repository verification has failed.
3. The method according to claim 1, characterized in that According to the verification result, the test identifier in the initial warehouse data is updated to obtain the target warehouse data; If the verification result indicates that the image repository verification has failed, updating the test flag to a flag indicating that no test is required; If the verification result is used to indicate that the image repository verification has failed, the test flag is not updated.
4. The method according to claim 1, characterized in that: The test data includes at least one test image and at least one Chart package.
5. The method according to claim 4, characterized in that The at least one preset test case includes at least one of a test case for testing the warehouse address login status, a test case for testing the test image upload status and download status, a test case for testing the Chart package upload status and download status, and a test case for testing concurrent downloads.
6. The method according to claim 1, characterized in that The step of testing the image repository corresponding to the target repository data according to the test data and at least one preset test case and generating a test report includes: For each preset test case, according to the test data, run the preset test case to test the image repository, and generate a log corresponding to the preset test case; Parse the logs corresponding to each preset test case and generate a test report.
7. The method according to claim 1, characterized in that The test report includes a test result corresponding to each preset test case, wherein the test result is used to indicate that the image repository has passed the test under the test case, or indicates that the image repository has failed the test under the test case; If the test result indicates that the image repository has failed the test under the test case, the test report also includes information about the reason why the test failed corresponding to the test case.
8. A mirror warehouse testing device, characterized in that: include: An acquisition module is used to acquire a list of image warehouses to be tested, wherein the list of image warehouses to be tested includes initial warehouse data corresponding to multiple image warehouses, wherein the initial warehouse data includes a warehouse address, login data, and a test identifier, wherein the test identifier is used to indicate that the image warehouse needs to be tested, or indicates that the test is not required; A verification module, for each test identifier indicating initial warehouse data to be tested, based on the warehouse address in the initial warehouse data and the login data, verifying the image warehouse corresponding to the initial warehouse data, and obtaining a verification result corresponding to the image warehouse, wherein the verification result is used to indicate that the image warehouse verification has passed, or indicates that the image warehouse verification has failed; Processing modules for: According to the verification result, the test identifier in the initial warehouse data is updated to obtain the target warehouse data; Generate configuration according to preset data and generate test data; The test module is used to test the image repository corresponding to each target repository data that needs to be tested according to each test identifier and at least one preset test case, and generate a test report.
9. An electronic device, characterized in that: include: Processor, memory, communication interface; The memory is used to store executable instructions of the processor; Wherein, the processor is configured to execute the image repository testing method according to any one of claims 1 to 7 by executing the executable instructions.
10. A readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the image repository testing method according to any one of claims 1 to 7 is implemented.