Software package installation test method and device, equipment and storage medium
By static resource configuration and initialization processing on the current system, the initial environment is generated, and the installation test and uninstallation test of each software package in the test package list are solved, and the problem of the installation test of software packages in the existing technology is solved, and efficient software package testing and uninstallation test is achieved.
Patent Information
- Application Number
- CN202311474777.7
- 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
In the prior art, software package installation and testing is long, testing efficiency is low, and there is a lack of full evaluation and package uninstallation testing of all software packages in the entire operating system.
By static resource configuration and initialization processing on the current system, an initial environment is generated; a list of software packages to be tested is determined, and each software package in the list of software packages to be tested is carried out in parallel, until all software package tests are completed.
A full evaluation of all software packages in the entire operating system was achieved, testing efficiency was improved, and uninstall residues or system corruption problems that may occur during the software package uninstallation process were discovered.
Smart Images

Figure CN119988203A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a software package installation test method, device, equipment and storage medium. Background Art
[0002] Currently, installation testing of software packages is an essential part of the software development process.
[0003] In the prior art, usually only a single software package is tested, and there is a lack of full evaluation of all software packages in the entire operating system, which results in a long time-consuming full test and low testing efficiency. Summary of the invention
[0004] The present application provides a software package installation test method, device, equipment and storage medium to solve the technical problems of software package installation test being time-consuming and having low test efficiency.
[0005] In a first aspect, the present application provides a software package installation test method, comprising:
[0006] Perform static resource configuration and initialization on the current system to generate the initial environment;
[0007] Determine a list of software packages to be tested; wherein the list of software packages to be tested includes multiple software packages to be tested;
[0008] Based on the initial environment, parallel installation tests are performed on each of the software packages to be tested in the list of software packages to be tested, and test results are determined.
[0009] Optionally, the method described above performs static resource configuration and initialization processing on the system environment to generate an initial environment, including:
[0010] Performing test tool software package configuration on the current system to install the test tool in the current system;
[0011] A file system snapshot and a file system subvolume are created based on the test tool, and the test directory is initialized to generate an initial environment.
[0012] Optionally, in the method described above, determining the list of software packages to be tested includes:
[0013] receiving a first instruction, and determining a software code library corresponding to the software to be tested according to the code library address information indicated by the first instruction;
[0014] The second instruction is received, and according to the version information and encoding information of the software package to be tested indicated by the second instruction, the software package to be tested in the software code library is determined and acquired, and the list of software packages to be tested is generated.
[0015] Optionally, the method as described above further comprises:
[0016] Acquire software package installation information of the current system, and generate a first software package list according to the installation information;
[0017] Acquire system core installation package information of the current system, and generate a first software package list according to the system core installation package information;
[0018] The target structure of the current system is backed up to generate backup directory information.
[0019] Optionally, the method described above, based on the initial environment, performs parallel installation tests on each software package to be tested in the software package list to be tested, and determines the test results, including:
[0020] Based on the initial environment, installation test and uninstallation test are performed on the software packages to be tested in the software package to be tested list, and test results are determined until no software packages to be tested exist in the software package to be tested list; wherein a preset number of software packages to be tested in the software package to be tested list are concurrently tested corresponding to a preset number of threads.
[0021] Optionally, the method described above, based on the initial environment, performs installation test and uninstallation test on the software packages to be tested in the list of software packages to be tested, and determines the test results, including:
[0022] Based on the test tool, in the initial environment, according to the file system snapshot and the file system subvolume, a test environment corresponding to the software package to be tested is created;
[0023] In the test environment, performing system installation processing on the software package to be tested, and if it is determined that the system installation of the software package to be tested is successful, determining that the installation test of the software package to be tested passes;
[0024] If it is determined that the installation test of the software package to be tested passes, uninstalling the successfully installed software package to be tested, and determining directory structure information of the system after uninstallation;
[0025] If it is determined that the directory structure information is consistent with the backup directory information, then it is determined that the uninstallation test of the software package to be tested passes;
[0026] If it is determined that there is difference information between the directory structure information and the backup directory information, it is determined that the uninstall test of the software package to be tested fails, and the difference information is output.
[0027] Optionally, the method as described above further comprises:
[0028] If it is determined that the system installation of the software package to be tested is unsuccessful, it is determined that the installation test of the software package to be tested has failed, and corresponding installation error information is output.
[0029] Optionally, in the method described above, after determining the test result, the method further comprises:
[0030] The file system snapshot and the file system subvolume in the test environment corresponding to the software package to be tested are deleted, and the test tool is cleared.
[0031] In a second aspect, the present application provides a software package installation test device, the device comprising:
[0032] The configuration unit is used to perform static resource configuration and initialization processing on the current system to generate an initial environment;
[0033] A determination unit, configured to determine a list of software packages to be tested; wherein the list of software packages to be tested includes a plurality of software packages to be tested;
[0034] The first processing unit is used to perform parallel installation tests on each software package to be tested in the software package list to be tested based on the initial environment, and determine the test results.
[0035] In a third aspect, the present application provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor;
[0036] The memory stores computer-executable instructions;
[0037] The processor executes the computer-executable instructions stored in the memory to implement the software package installation test method as described in the first aspect.
[0038] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions. When a processor executes the computer-executable instructions, the software package installation test method as described in the first aspect is implemented.
[0039] The software package installation test method, apparatus, device and storage medium provided in the present application include the following steps: static resource configuration and initialization processing are performed on the current system to generate an initial environment; a list of software packages to be tested is determined; wherein the list of software packages to be tested includes multiple software packages to be tested; based on the initial environment, each software package to be tested in the list of software packages to be tested is installed and tested in parallel, and the test results are determined, thereby achieving a full evaluation of all software packages of the entire operating system and improving the test efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] 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.
[0041] Figure 1 A flowchart of a software package installation test method provided in an embodiment of the present application;
[0042] Figure 2 A flowchart of another software package installation test method provided in an embodiment of the present application;
[0043] Figure 3 A schematic diagram of the structure of a software package installation test device provided in an embodiment of the present application;
[0044] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present 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] Currently, installation testing of software packages is an essential part of the software development process.
[0048] Existing methods usually only test a single software package, and lack a full evaluation of all software packages in the entire operating system, resulting in a long time-consuming full test and low test efficiency. In addition, there is a lack of software package uninstallation testing, and problems such as uninstall residues and system damage that may occur in the uninstallation process of some software packages cannot be discovered, which may cause the system to be unable to be used normally after the test is completed and can only be reinstalled.
[0049] The software package installation test method provided in this application is intended to solve the above technical problems in the prior art.
[0050] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0051] Figure 1 A flowchart of a software package installation test method provided in an embodiment of the present application, such as Figure 1 As shown, the method includes:
[0052] 101. Perform static resource configuration and initialization processing on the current system to generate an initial environment.
[0053] Exemplarily, static files and information are configured for the current system, that is, static resource configuration, and the test space is initialized to generate an initial environment, wherein the initial environment can be further loaded and built into a test environment.
[0054] 102. Determine a list of software packages to be tested; wherein the list of software packages to be tested includes multiple software packages to be tested.
[0055] Exemplarily, according to the test requirements, a list of software packages to be tested is determined, wherein the list of software packages to be tested includes multiple software packages to be tested, and the software packages to be tested in the list of software packages to be tested may include a full set of software packages required to be installed for a system.
[0056] 103. Based on the initial environment, perform parallel installation tests on each of the software packages to be tested in the software package list to be tested, and determine the test results.
[0057] Exemplarily, based on the generated initial environment, each software package in the software package list is installed and tested in parallel, that is, each software package corresponds to an independent test environment, and under the premise of a certain concurrency number, each software package is tested concurrently, and the test result of each software package is determined.
[0058] In summary, the software package installation test method provided in this embodiment includes the following steps: static resource configuration and initialization processing are performed on the current system to generate an initial environment; a list of software packages to be tested is determined; wherein the list of software packages to be tested includes multiple software packages to be tested; based on the initial environment, each software package to be tested in the list of software packages to be tested is installed and tested in parallel, and a test result is determined, thereby achieving a full evaluation of all software packages of the entire operating system and improving the test efficiency.
[0059] Figure 2 A flowchart of another software package installation test method provided in an embodiment of the present application, such as Figure 2 As shown, the method includes:
[0060] 201. Configure the test tool software package for the current system to install the test tool in the current system.
[0061] Exemplarily, the test tool is installed on the current system to install the test tool in the current system, that is, to install the test dependent software packages, such as btrfs-progs, mock, etc.
[0062] 202. Create a file system snapshot and a file system subvolume based on the test tool, initialize the test directory, and generate an initial environment.
[0063] Exemplarily, file system snapshots and file system subvolumes are created based on the installed test tool. For example, btrfs is used to create file system snapshots and file system subvolumes. The mock tool configuration, including plugin_conf, yum.conf, etc., is modified accordingly. The test directory is initialized, including disk partitioning, formatting, mounting, etc., to generate an initial environment.
[0064] 203. Determine the list of software packages to be tested.
[0065] In one example, step 203 includes the following steps:
[0066] A first instruction is received, and a software code library corresponding to the software to be tested is determined according to the code library address information indicated by the first instruction.
[0067] The second instruction is received, and according to the version information and encoding information of the software package to be tested indicated by the second instruction, the software package to be tested in the software code library is determined and obtained, and a list of software packages to be tested is generated.
[0068] In one example, the method further includes: obtaining software package installation information of the current system and generating a first software package list based on the installation information; obtaining system core installation package information of the current system and generating a first software package list based on the system core installation package information; backing up the target structure of the current system and generating backup directory information.
[0069] Exemplarily, a first instruction is received, such as a yum repolist -v command, and a software code library (repo source) corresponding to the software to be tested is determined according to the code library address information indicated by the first instruction. After the software code library is determined, according to a second instruction and according to the version information and encoding information of the software package to be tested indicated by the second instruction, the software package to be tested in the software code library is determined and obtained. For example, based on the yum list command, the software packages in the specified repo source are obtained and filtered to generate a list of software packages to be tested.
[0070] It is also possible to obtain the software package installation information of the current system and generate a first software package list according to the installation information; obtain the system core installation package information of the current system and generate a first software package list according to the system core installation package information; back up the target structure of the current system and generate backup directory information.
[0071] 204. Based on the initial environment, perform installation test and uninstallation test on the software packages to be tested in the software package list to be tested, and determine the test results until no software packages to be tested exist in the software package list to be tested; wherein a preset number of software packages to be tested in the software package list to be tested corresponds to a preset number of threads to perform concurrent testing.
[0072] In one example, for each software package to be tested, step 204 includes the following steps:
[0073] Based on the test tool, in the initial environment, a test environment corresponding to the software package to be tested is created according to the file system snapshot and the file system subvolume.
[0074] In the test environment, the software package to be tested is subjected to system installation processing. If it is determined that the system installation of the software package to be tested is successful, it is determined that the installation test of the software package to be tested passes.
[0075] If it is determined that the installation test of the software package to be tested passes, the successfully installed software package to be tested is uninstalled, and directory structure information of the system after the uninstallation is determined.
[0076] If it is determined that the directory structure information is consistent with the backup directory information, it is determined that the uninstallation test of the software package to be tested passes.
[0077] If it is determined that there is difference information between the directory structure information and the backup directory information, it is determined that the uninstall test of the software package to be tested fails, and the difference information is output.
[0078] In one example, if it is determined that the system installation of the software package to be tested is unsuccessful, it is determined that the installation test of the software package to be tested has failed, and corresponding installation error information is output.
[0079] In one example, after determining the test result, the method further includes: deleting the file system snapshot and the file system subvolume in the test environment corresponding to the software package to be tested, and clearing the test tool.
[0080] Exemplarily, for each software package to be tested, there is a corresponding thread in a thread pool, which is used to create a test environment corresponding to the software package to be tested in an initial environment based on a test tool and according to a file system snapshot and a file system subvolume. For example, a mock tool is used to create a test environment corresponding to the software package to be tested based on the file system snapshot and the file system subvolume. In the test environment, the software package to be tested is system installed. If it is determined that the system installation of the software package to be tested is successful, it is determined that the installation test of the software package to be tested has passed; if it is determined that the installation test of the software package to be tested has passed, the successfully installed software package to be tested is uninstalled, and the directory structure information of the system after uninstallation is determined; if it is determined that the directory structure information is consistent with the backup directory information, it is determined that the uninstallation test of the software package to be tested has passed; if it is determined that there is difference information between the directory structure information and the backup directory information, it is considered that the uninstallation package has an impact on the system, and it is determined that the uninstallation test of the software package to be tested has failed, and the difference information is output.
[0081] If it is determined that the system installation of the software package to be tested is unsuccessful, it is determined that the installation test of the software package to be tested has failed, and a corresponding installation error message is output. Wherein, the unsuccessful installation may include the following situations, and different installation error messages are output in different situations:
[0082] (1) In case of conflict with existing system installation packages, the conflicting installation packages will be uninstalled and tested again. (2) In case of installation failure due to signature verification failure, the unsuccessful software package information will be output, along with the corresponding verification error information. (3) In case of installation failure due to lack of dependencies, the unsuccessful software package information and the missing dependency information will be output.
[0083] In one example, a thread pool is maintained based on the python subprocess module, the number of concurrent connections is customized, and polling is used to determine whether there are currently empty threads available. Each test thread executes the content of step 204, and each test thread corresponds to the installation and uninstallation test process of a software package, until all software packages are tested and the process ends.
[0084] After the test results are determined, the file system snapshots and file system subvolumes in the test environment corresponding to each software package to be tested are deleted, and the test tools are cleared. That is, the file system subvolumes and snapshots created by btrfs are deleted, and the created mock configuration files are deleted. When testing another software package to be tested, the environment is re-installed to avoid test failures due to the influence between the software packages to be tested. The thread pool used for testing can also be detected, and the abnormally hung threads are deleted and the thread program number is returned, and the software package corresponding to the thread with the serial number is output as a test failure package.
[0085] In summary, in this embodiment, a full evaluation of all software packages of the entire operating system is achieved, the test efficiency is improved, and the uninstall test of the software package is implemented, which can detect problems such as uninstall residues and system damage that may occur in some software packages during the uninstallation process; the software package installation and uninstallation test is implemented based on multi-threading, which improves the test performance and shortens the test time.
[0086] Figure 3 A schematic diagram of the structure of a software package installation test device provided in an embodiment of the present application, such as Figure 3 As shown, the device comprises:
[0087] The configuration unit 31 is used to perform static resource configuration and initialization processing on the current system to generate an initial environment.
[0088] The determination unit 32 is used to determine a list of software packages to be tested; wherein the list of software packages to be tested includes multiple software packages to be tested.
[0089] The first processing unit 33 is used to perform parallel installation tests on the software packages to be tested in the software package list to be tested based on the initial environment, and determine the test results.
[0090] In one example, the configuration unit 31 includes:
[0091] The first configuration subunit is used to configure the test tool software package for the current system so as to install the test tool in the current system.
[0092] The second configuration subunit is used to create a file system snapshot and a file system subvolume based on the test tool, and initialize the test directory to generate an initial environment.
[0093] In one example, the determining unit 32 includes:
[0094] The first determining subunit is used to receive a first instruction and determine a software code library corresponding to the software to be tested according to the code library address information indicated by the first instruction.
[0095] The first determining subunit is used to receive the second instruction, and determine and obtain the software package to be tested in the software code library according to the version information and encoding information of the software package to be tested indicated by the second instruction, and generate a list of software packages to be tested.
[0096] In one example, the device further includes:
[0097] The first generating unit is used to obtain software package installation information of the current system and generate a first software package list according to the installation information.
[0098] The first generating unit is used to obtain the system core installation package information of the current system and generate a first software package list according to the system core installation package information.
[0099] The first generating unit is used to perform backup processing on the target structure of the current system and generate backup directory information.
[0100] In one example, the first processing unit 33 is specifically configured to:
[0101] Based on the initial environment, the software packages to be tested in the software package list to be tested are subjected to installation test and uninstallation test, and the test results are determined until no software packages to be tested exist in the software package list to be tested; wherein a preset number of software packages to be tested in the software package list to be tested corresponds to a preset number of threads to be tested concurrently.
[0102] In one example, the first processing unit 33 includes:
[0103] The first processing subunit is used to create a test environment corresponding to the software package to be tested in the initial environment based on the test tool and according to the file system snapshot and the file system subvolume.
[0104] The first execution subunit is used to perform system installation processing on the software package to be tested in the test environment, and if it is determined that the system installation of the software package to be tested is successful, then determine that the installation test of the software package to be tested passes.
[0105] The second processing sub-unit is used for uninstalling the successfully installed software package to be tested if it is determined that the installation test of the software package to be tested passes, and determining the directory structure information of the system after the uninstallation;
[0106] The second execution subunit is used to determine that the uninstall test of the software package to be tested passes if it is determined that the directory structure information is consistent with the backup directory information.
[0107] The third processing subunit is configured to determine that the uninstall test of the software package to be tested fails if it is determined that there is difference information between the directory structure information and the backup directory information, and output the difference information.
[0108] In one example, the first processing unit 33 further includes:
[0109] The fourth processing subunit is used to determine that the installation test of the software package to be tested fails if it is determined that the system installation of the software package to be tested fails, and output corresponding installation error information.
[0110] In one example, after the first processing unit 33, the device further includes:
[0111] The second processing unit is used to delete the file system snapshot and the file system subvolume in the test environment corresponding to the software package to be tested, and clear the test tool.
[0112] An embodiment of the present application further provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, a software package installation test method as in any embodiment is implemented.
[0113] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown in FIG. Figure 4 As shown, the electronic device includes: a processor 41, and a memory 42 communicatively connected to the processor.
[0114] Memory 42 stores computer executable instructions.
[0115] The processor 41 executes the computer-executable instructions stored in the memory to implement the software package installation test method of any of the above embodiments.
[0116] An embodiment of the present application also provides a computer program product, which includes: a computer program, the computer program is stored in a readable storage medium, at least one processor of an electronic device can read the computer program from the readable storage medium, and at least one processor executes the computer program so that the electronic device executes the software package installation test method provided in any of the above embodiments.
[0117] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application.
[0118] It should be further noted that, although the various steps in the flowchart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowchart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
[0119] It should be understood that the above-mentioned device embodiments are only illustrative, and the device of the present application can also be implemented in other ways. For example, the division of units / modules in the above-mentioned embodiments is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units, modules or components can be combined, or can be integrated into another system, or some features can be ignored or not executed.
[0120] In addition, unless otherwise specified, each functional unit / module in each embodiment of the present application may be integrated into one unit / module, each unit / module may exist physically separately, or two or more units / modules may be integrated together. The above-mentioned integrated unit / module may be implemented in the form of hardware or in the form of a software program module.
[0121] If the integrated unit / module is implemented in the form of hardware, the hardware may be a digital circuit, an analog circuit, etc. The physical implementation of the hardware structure includes but is not limited to transistors, memristors, etc. If not specifically stated, the processor may be any appropriate hardware processor, such as a CPU, a GPU, an FPGA, a DSP, an ASIC, etc. If not specifically stated, the storage unit may be any appropriate magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory RRAM (Resistive Random Access Memory), a dynamic random access memory DRAM (Dynamic Random Access Memory), a static random access memory SRAM (Static Random-Access Memory), an enhanced dynamic random access memory EDRAM (Enhanced Dynamic Random Access Memory), a high-bandwidth memory HBM (High-Bandwidth Memory), a hybrid memory cube HMC (Hybrid Memory Cube), etc.
[0122] If the integrated unit / module is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.
[0123] In the above embodiments, the description of each embodiment has its own emphasis. For the part not described in detail in a certain embodiment, please refer to the relevant description of other embodiments. The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0124] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0125] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A software package installation test method, characterized in that: The method comprises: Perform static resource configuration and initialization on the current system to generate the initial environment; Determine a list of software packages to be tested; wherein the list of software packages to be tested includes multiple software packages to be tested; Based on the initial environment, parallel installation tests are performed on each of the software packages to be tested in the list of software packages to be tested, and test results are determined.
2. The method according to claim 1, characterized in that Perform static resource configuration and initialization on the current system to generate the initial environment, including: Performing test tool software package configuration on the current system to install the test tool in the current system; A file system snapshot and a file system subvolume are created based on the test tool, and the test directory is initialized to generate an initial environment.
3. The method according to claim 2, characterized in that Determine the list of packages to be tested, including: receiving a first instruction, and determining a software code library corresponding to the software to be tested according to the code library address information indicated by the first instruction; The second instruction is received, and according to the version information and encoding information of the software package to be tested indicated by the second instruction, the software package to be tested in the software code library is determined and acquired, and the list of software packages to be tested is generated.
4. The method according to claim 3, characterized in that The method further comprises: Acquire software package installation information of the current system, and generate a first software package list according to the installation information; Acquire system core installation package information of the current system, and generate a first software package list according to the system core installation package information; The target structure of the current system is backed up to generate backup directory information.
5. The method according to claim 4, characterized in that Based on the initial environment, performing parallel installation tests on each software package to be tested in the software package list to be tested, and determining the test results, including: Based on the initial environment, installation test and uninstallation test are performed on the software packages to be tested in the software package to be tested list, and test results are determined until no software packages to be tested exist in the software package to be tested list; wherein a preset number of software packages to be tested in the software package to be tested list are concurrently tested corresponding to a preset number of threads.
6. The method according to claim 5, characterized in that Based on the initial environment, performing installation test and uninstallation test on the software packages to be tested in the list of software packages to be tested, and determining the test results, including: Based on the test tool, in the initial environment, according to the file system snapshot and the file system subvolume, a test environment corresponding to the software package to be tested is created; In the test environment, performing system installation processing on the software package to be tested, and if it is determined that the system installation of the software package to be tested is successful, determining that the installation test of the software package to be tested passes; If it is determined that the installation test of the software package to be tested passes, uninstalling the successfully installed software package to be tested, and determining directory structure information of the system after uninstallation; If it is determined that the directory structure information is consistent with the backup directory information, then it is determined that the uninstallation test of the software package to be tested passes; If it is determined that there is difference information between the directory structure information and the backup directory information, it is determined that the uninstall test of the software package to be tested fails, and the difference information is output.
7. The method according to claim 6, characterized in that The method further comprises: If it is determined that the system installation of the software package to be tested is unsuccessful, it is determined that the installation test of the software package to be tested has failed, and corresponding installation error information is output.
8. The method according to any one of claims 6 to 7, characterized in that: After determining the test results, the method further includes: The file system snapshot and the file system subvolume in the test environment corresponding to the software package to be tested are deleted, and the test tool is cleared.
9. A software package installation test device, characterized in that: The device comprises: The configuration unit is used to perform static resource configuration and initialization processing on the current system to generate an initial environment; A determination unit, configured to determine a list of software packages to be tested; wherein the list of software packages to be tested includes a plurality of software packages to be tested; The first processing unit is configured to perform parallel installation tests on the individual software packages to be tested in the list of software packages to be tested based on the initial environment, and determine test results.
10. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the software package installation test method according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the software package installation test method according to any one of claims 1 to 8 when executed by a processor.
Citation Information
Patent Citations
System and method for realizing software one-key deployment and automatic test based on Ansible
CN110795356A
Method and apparatus for environment-variable driven software testing
US5634098A