Automatic testing method of embedded operating system and related product
By obtaining the target recipe file to determine the functional modules to be tested and test cases, automated testing of the embedded operating system is realized, which solves the problem of low testing efficiency in the existing technology and improves testing efficiency and accuracy.
Patent Information
- Application Number
- CN202410678050.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-28
- Publication Date
- 2024-08-30
- Estimated Expiration
- Not applicable · inactive patent
Smart Images

Figure CN118567981A
Abstract
Description
Technical Field
[0001] The present application relates to the field of automated testing technology, and in particular to an automated testing method for an embedded operating system and related products. Background Art
[0002] With the rapid development of intelligence, people have higher and higher requirements for software systems. Therefore, software systems need to be iterated frequently to cope with more and more complex business changes or adjustments in software systems. In order to ensure the quality of software systems, each version iteration needs to be tested accordingly.
[0003] Take the embedded operating system (OS) as an example. As the business changes or adjusts, the embedded OS will iterate its version, and its system scale will continue to increase, and the number of test cases will also increase. The existing methods for testing embedded OS are either full-scale automated testing (using all test cases in the test case library to test the embedded OS) or manually selecting test cases for testing. Both testing methods take a lot of time to execute, which leads to the problem of low test efficiency.
[0004] Therefore, how to improve the testing efficiency of embedded operating systems is a problem that technical personnel in this field need to solve urgently. Summary of the invention
[0005] Based on the above problems, the embodiments of the present application provide an automated testing method and related products for an embedded operating system, which determines the functional modules of the embedded operating system that have been modified in this construction through a recipe file, and then uses the corresponding test cases to perform testing, thereby performing targeted testing on the embedded operating system without the need for human intervention, thereby solving the problem of low efficiency of embedded operating system testing in the prior art.
[0006] In the first aspect, the embodiment of the present application provides an automated testing method for an embedded operating system, including: obtaining a target recipe file corresponding to the current build of the embedded operating system; determining the functional module to be tested corresponding to the current build based on the target recipe file, the functional module to be tested being the functional module of the embedded operating system that has been modified compared to the previous build; determining the target test case corresponding to the functional module to be tested based on a preset correspondence; and testing the embedded operating system based on the target test case. In this way, the embodiment of the present application determines the functional module of the embedded operating system that has been modified in this build through the recipe file, and then uses the corresponding test case to test it, so as to perform targeted testing on the embedded operating system without manual intervention, thereby improving the testing efficiency of the embedded operating system.
[0007] In a possible implementation, the method of determining the functional module to be tested corresponding to the current build based on the target recipe file includes: comparing the target recipe file with the original recipe file to determine the patch file generated by the current build; the original recipe file is a script (BitBake, BB) file recorded by the previous build of the embedded operating system; and determining the functional module to be tested in the embedded operating system according to the patch file. In this way, the embodiment of the present application introduces a method of determining the functional module to be tested, which determines the modified functional module in the embedded operating system based on the modified standardized named patch file through a simple comparison logic between recipe files, thereby improving the efficiency of determining the functional module to be tested and the accuracy of determining the functional module to be tested.
[0008] In a possible implementation, the method of determining the function module to be tested in the embedded operating system according to the patch file includes: reading the file name of the patch file; and identifying the function module to be tested corresponding to the embedded operating system from the file name based on keyword extraction technology. In this way, since the standardized naming of the patch file can directly indicate the corresponding function module, the embodiment of the present application introduces a method of determining the function module to be tested, which directly determines the function module to be tested from the file name of the patch file through keyword extraction technology, thereby improving the efficiency of determining the function module to be tested.
[0009] In a possible implementation, the method of determining the function module to be tested in the embedded operating system according to the patch file includes: opening the patch file; parsing the file content of the patch file, and identifying the function module to be tested corresponding to the embedded operating system from the file content based on keyword extraction technology. In this way, since the function name and the written content in the patch file will clearly point to the corresponding function module, the embodiment of the present application introduces a method of determining the function module to be tested, which parses the file content of the patch file through keyword extraction technology, and then determines the function module to be tested, thereby improving the accuracy of determining the function module to be tested.
[0010] In a possible implementation, the determining the test case corresponding to the functional module to be tested includes: determining a label corresponding to the functional module to be tested; determining a target test case corresponding to the functional module to be tested according to the label; the label is used to indicate the functional module corresponding to each test case. In this way, the embodiment of the present application introduces a label, and uses the label to indicate the functional module corresponding to each test case, thereby clearly forming a mapping relationship between the test case and the functional module, and improving the accuracy and efficiency of determining the target test case.
[0011] In a possible implementation, the testing of the embedded operating system based on the target test case includes: sending the target test case to an execution machine, so that the execution machine uses the target test case to test the embedded operating system. In this way, the embodiment of the present application introduces a method for screening target test cases, in which the case management system screens the corresponding target test cases based on the tags and sends them to the execution machine for execution, thereby ensuring the accuracy and efficiency of the system test.
[0012] In a possible implementation, the determining of the target test case corresponding to the functional module to be tested according to the label includes: sending the label to the execution machine, so that the execution machine filters out the corresponding target test case according to the label. In this way, the embodiment of the present application introduces another method of screening target test cases. The use case management system directly sends the label to the execution machine, and the execution machine screens the corresponding target test cases, which reduces the burden of the use case management system and ensures the accuracy and efficiency of system testing.
[0013] In a possible implementation, the embedded operating system is tested based on the target test case, including: based on the execution machine, the embedded operating system is tested using the target test case screened by the execution machine. In this way, the embodiment of the present application introduces another system testing method, in which the execution machine screens the corresponding target test case and executes the test, which reduces the burden of the use case management system and ensures the accuracy and efficiency of the system test. In a possible implementation, the determination of the label corresponding to the functional module to be tested includes: determining the label corresponding to the functional module to be tested based on a pre-set label field; the label field includes a functional module, a label, and a corresponding relationship between the functional module and the label. In this way, the embodiment of the present application introduces a label field, writes a field representing the corresponding relationship between the functional module and the label in the use case management system, and when the use case management system determines the functional module to be tested, it directly determines the corresponding target test case based on the label field, thereby improving the accuracy and efficiency of determining the target test case.
[0014] In a second aspect, an embodiment of the present application provides a server, comprising: a memory for storing a computer program; and a processor for implementing the steps of the automated testing method for an embedded operating system as described above when executing the computer program.
[0015] It can be seen from the above technical solutions that compared with the prior art, the embodiments of the present application have the following advantages:
[0016] The embodiment of the present application first obtains the target recipe file corresponding to the current construction of the embedded operating system. Then, the functional module to be tested corresponding to the current construction is determined based on the target recipe file. Wherein, the functional module to be tested is the functional module of the embedded operating system that has been modified compared to the previous construction. Finally, based on the preset corresponding relationship, the target test case corresponding to the functional module to be tested is determined, and the embedded operating system is tested based on the target test case. In this way, the functional module that has been modified in the current construction of the embedded operating system is determined by the recipe file, and then the corresponding test case is determined, and the embedded operating system is tested. In a fully automatic manner, the embedded operating system is tested in a targeted manner without manual intervention, and it is not necessary to test the embedded operating system with all the test cases in the library after each construction, and it is also avoided that the time is wasted and the problem of omissions is easily caused by manually selecting test cases, thereby improving the test efficiency of the embedded operating system. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 A flowchart of an automated testing method for an embedded operating system provided in an embodiment of the present application;
[0018] Figure 2 A flowchart of a method for implementing automated testing by screening target test cases by a use case management system provided in an embodiment of the present application;
[0019] Figure 3 A flowchart of a method for implementing automated testing by screening target test cases using an automated testing framework provided in an embodiment of the present application;
[0020] Figure 4 A schematic diagram of an automated testing system framework for an embedded operating system provided in an embodiment of the present application;
[0021] Figure 5 A schematic diagram of the structure of an automated testing device for an embedded operating system provided in an embodiment of the present application;
[0022] Figure 6 A schematic diagram of the structure of a BMC provided in an embodiment of the present application;
[0023] Figure 7 A schematic diagram of a server structure provided in an embodiment of the present application. DETAILED DESCRIPTION
[0024] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0025] In the description of the embodiments of the present application, words such as "exemplary", "for example" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary", "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary", "for example" or "for example" is intended to present related concepts in a concrete way.
[0026] In the description of the embodiments of the present application, the term "and / or" is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, B exists alone, and A and B exist at the same time. In addition, unless otherwise specified, the term "multiple" means two or more. For example, multiple systems refers to two or more systems, and multiple terminals refers to two or more terminals.
[0027] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. The terms "include", "comprises", "has" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.
[0028] Hereinafter, some terms used in this embodiment are explained. It should be noted that these explanations are for the convenience of understanding by those skilled in the art and do not constitute a limitation on the scope of protection claimed by the present invention.
[0029] BB file is the abbreviation of BitBake file, which is a script file for describing the metadata and construction rules of a software package. In the embodiment of the present application, BB file is also referred to as recipe file.
[0030] A patch file is a text file used to describe code changes, which contains the modified content of the code file and related metadata information, such as the submitter, submission time, etc.
[0031] Embedded OS refers to an operating system for embedded systems. Embedded OS is a widely used system software, usually including hardware-related underlying driver software, system kernel, device driver interface, communication protocol, graphical interface, standardized browser, etc. In the embodiment of the present application, the embedded OS runs on the baseboard management controller (BMC).
[0032] As mentioned above, the existing embedded OS testing methods have the problem of very low testing efficiency. Specifically, the existing testing methods cannot respond well to the embedded OS, which is currently growing in scale and has an increasing number of test cases. The existing testing methods are either full-scale automated testing or testing by manually selecting test cases. For full-scale automated testing, although the embedded OS is only slightly modified and only involves changes to a small number of functional modules, all test cases in the test case library must still be used to test the current embedded OS, resulting in redundant testing of some functional modules, which in turn leads to very low testing efficiency. Although manual selection of test cases can effectively target modified functional modules, it requires a lot of time investment and is prone to human omissions, which also leads to the problem of very low testing efficiency.
[0033] To solve the above problems, an embodiment of the present application provides an automated testing method for an embedded operating system, comprising: first obtaining a target recipe file corresponding to the current build of the embedded operating system. Determining the functional module to be tested corresponding to the current build based on the target recipe file. The functional module to be tested is a functional module of the embedded operating system that has been modified compared to the previous build. Finally, based on a preset corresponding relationship, determining the target test case corresponding to the functional module to be tested, and testing the embedded operating system based on the target test case.
[0034] In this way, the functional modules of the embedded operating system that have been modified in this build are determined through the recipe file, and then the corresponding test cases are determined, and the embedded operating system is tested. In a fully automatic way, the embedded operating system is tested in a targeted manner without manual intervention. It is not necessary to test the embedded operating system with all the test cases in the library after each build, and it also avoids the problem of wasting time and easy omissions in manually selecting test cases, thereby improving the testing efficiency of the embedded operating system.
[0035] It should be noted that the automated testing method for an embedded operating system and related products provided by the present application can be applied to the field of automated testing technology. The above is only an example and does not limit the application field of the automated testing method for an embedded operating system and related products provided by the present application.
[0036] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0037] Figure 1 A flowchart of an automated testing method for an embedded operating system provided in an embodiment of the present application. Figure 1 As shown, an automated testing method for an embedded operating system provided in an embodiment of the present application may include:
[0038] S101: Obtain the target recipe file corresponding to the current build of the embedded operating system.
[0039] In practical applications, the business will be updated from time to time, and the embedded OS needs to be iterated with the changes or adjustments of the business. In order to ensure the quality of the embedded OS, it is necessary to perform corresponding tests after each version iteration of the embedded OS. Among them, the embedded OS includes multiple functional modules, such as smart contracts, consensus algorithms, account systems, resource allocation, community governance, cross-chain communication, and side chain technology, etc. There may be associations between different functional modules, and the corresponding test cases are also different. The functional modules involved in the changes in each version iteration of the embedded OS are not fixed in number and type, resulting in the real effective test cases being fixed each time the test is performed. Therefore, how to quickly and accurately determine the real effective test cases each time the test is tested has become the key. The embodiment of the present application provides a use case management system, which uses the system to realize full automatic, fast and accurate determination of the test cases required for the test, and then realizes targeted testing of the embedded OS after each version iteration. Specifically, taking the construction system as an example of building the embedded OS once every night, each time the construction is completed, the construction system will record the current recipe file (BB file) of the current version of the embedded OS as the target recipe file. Among them, construction refers to compiling a testable software package corresponding to the embedded OS. Due to the characteristics of BB files, the metadata and structural rules of the software package corresponding to the embedded OS can be obtained by parsing the BB files, and then the functional modules that have been modified can be determined. Therefore, in order to determine the functional modules that have been modified, the use case management system first needs to obtain the current BB file corresponding to the current build of the embedded OS. The BB file is generally stored in the memory of the build system according to the timing. In this way, the use case management system directly obtains the BB file from the memory of the build system and then determines the functional module to be tested, which improves the accuracy of determining the functional module to be tested.
[0040] S102: Determine a function module to be tested based on the target recipe file, where the function module to be tested is a function module of the embedded operating system that has been modified compared to a previous build.
[0041] In practical applications, combined with the above, it can be known that the BB file includes the metadata and structural rules of the software package corresponding to the embedded OS. Taking the case that a small number of functional modules have changed in this build of the embedded OS as an example, the BB file recorded after the build is completed records the data corresponding to the functional modules that have changed compared to the previous build, as well as the data corresponding to the functional modules that have not changed. The use case management system can first determine the changed data from the BB file through data analysis based on the corresponding relationship between the functional modules and the data, and then determine the functional modules to be tested (the functional modules that have changed compared to the previous build) based on the changed data. In this way, the use case management system directly determines the functional modules to be tested based on the BB file, thereby improving the accuracy of determining the functional modules to be tested.
[0042] In addition, since the methods for determining the functional modules to be tested are not the same, the embodiments of the present application can illustrate a possible determination method.
[0043] In one case, determining the functional module to be tested corresponding to the current build based on the target recipe file includes:
[0044] Compare the target recipe file with the original recipe file to determine the patch file generated by this build; the original recipe file is the BB file recorded in the last build of the embedded operating system;
[0045] The function module to be tested in the embedded operating system is determined according to the patch file.
[0046] In practical applications, the file changes can be determined by comparing BB files, and then the function module to be tested is determined. Specifically, the construction system generates and records new BB files every time the embedded OS is constructed, and based on the characteristics of the BB files, the difference between the BB files generated by this construction and the BB files generated by the last construction is the data change of the function module for this construction. In an embodiment of the present application, the use case management system adopts a simple comparison logic to compare the target recipe file (the BB file recorded by this construction) with the original recipe file (the BB file recorded by the last construction) to determine the data difference (generated patch file) between the two. The construction of the embedded OS or the change content of the function module is directly pointed to by the patch file added in the original BB file. It is understandable that the patch file contains the modified content of the code file, and related metadata information, such as submitter, submission time, etc., indicating the specific change form of a certain function module of the embedded OS. Therefore, the use case management system can first determine the patch file newly added to the BB file recorded by the embedded OS after this build, and parse the patch file to determine the object of modification indicated therein, that is, the functional module to be tested (the functional module that has changed in this build). In this way, the functional module to be tested is determined based on the patch file, which improves the accuracy of determining the functional module to be tested.
[0047] In addition, since the methods for determining the functional module to be tested according to the patch file are not the same, the embodiment of the present application can illustrate a possible determination method.
[0048] In one case, determining the functional module to be tested in the embedded operating system according to the patch file includes:
[0049] Read the file name of the patch file;
[0050] Based on the keyword extraction technology, the function module to be tested corresponding to the embedded operating system is identified from the file name.
[0051] In actual applications, in order to facilitate distinction and organization, each company has its own set of standardized naming rules for the naming of patch files. The naming of patch files is usually named after the functional module they point to, for example, adding a contract.patch in the smart contract, adjusting b algorithm.patch in the consensus algorithm, or adding c governance means.patch in community governance, etc. In this context, the use case management system provided in the embodiment of the present application can use keyword extraction technology to directly identify the functional modules to be tested, such as "smart contract", "consensus algorithm", "community governance", etc., corresponding to the embedded operating system built this time, from the file names of such patch files mentioned in the above examples. In this way, the keyword extraction technology directly identifies the corresponding functional modules to be tested from the file names, improves the efficiency of determining the functional modules to be tested, and thereby improves the testing efficiency of the embedded operating system.
[0052] In addition, since the methods for determining the functional module to be tested according to the patch file are not the same, the embodiment of the present application can illustrate another possible determination method.
[0053] In another case, determining the functional module to be tested in the embedded operating system according to the patch file includes:
[0054] Open the patch file;
[0055] The file content of the patch file is parsed, and the function module to be tested corresponding to the embedded operating system is identified from the file content based on a keyword extraction technology.
[0056] In actual applications, different companies have different naming conventions for patch files, and there are cases where the words corresponding to the functional modules do not appear in the file names of some patch files. In this context, the means of continuing to extract the words of the functional modules from the file names of patch files will become unavailable. Therefore, the embodiment of the present application provides another parsing method, based on the file characteristics of patch files used to describe code changes, the use case management system opens the patch file, and uses keyword extraction technology to parse the patch file generated by this construction to determine the functional module to be tested (the functional module pointed to by the code change in the patch file). In this way, the functional module to be tested is determined by replacing the file name parsing with content parsing, thereby improving the accuracy of determining the functional module to be tested.
[0057] S103: Based on the preset corresponding relationship, determine the target test case corresponding to the functional module to be tested. In practical applications, the test case has been corresponding to the functional module when it is designed, that is, there is a preset corresponding relationship between the two. Therefore, after determining the functional module to be tested, the case management system can determine the target test case corresponding to the functional module to be tested based on the corresponding relationship, so that the subsequent execution machine can use the target test case for testing. For example, there are functional modules X, Y and Z, and test cases A and B are designed for testing. During the design, test case A is bound to functional module X, and test case B is bound to functional module Y and functional module Z. Then, if the case management system determines that functional module X is the functional module to be tested, test case A can be determined as the target test case through the preset corresponding relationship; if the case management system determines that functional module Y and / or functional module Z are the functional modules to be tested, test case B can be determined as the target test case through the mapping relationship. In this way, based on the preset corresponding relationship, after determining the functional module to be tested, the corresponding target test case can be quickly determined, thereby improving the efficiency of the test.
[0058] S104: Testing the embedded operating system based on the target test case.
[0059] In actual applications, after determining the target test case, the execution machine needs to be called to test the embedded operating system based on the target test case. In this way, the case management system and the execution machine are used together to perform targeted tests on the embedded operating system without manual intervention, thereby improving the testing efficiency of the embedded operating system.
[0060] In summary, the embodiment of the present application provides an automated testing method for an embedded operating system, first obtaining the target recipe file corresponding to the current build of the embedded operating system. Then, the functional module to be tested corresponding to the current build is determined based on the target recipe file. Wherein, the functional module to be tested is the functional module of the embedded operating system that has been modified compared to the previous build. Finally, based on the preset corresponding relationship, the target test case corresponding to the functional module to be tested is determined, and the embedded operating system is tested based on the target test case. In this way, the functional module of the embedded operating system that has been modified in this build is determined by the recipe file, and then the corresponding test case is determined, and the embedded operating system is tested. In a fully automatic manner, the embedded operating system is tested in a targeted manner without manual intervention, and it is not necessary to test the embedded operating system using all the test cases in the library after each build, and it is also avoided that the time is wasted and the problem of omissions is easily caused by manually selecting test cases, thereby improving the testing efficiency of the embedded operating system.
[0061] In addition, since the subjects of the screening target test cases are different, the embodiment of the present application provides an implementation method for explanation.
[0062] Figure 2 A flowchart of a method for implementing automated testing by using a test case management system to screen target test cases is provided in an embodiment of the present application. Figure 2 As shown, a method provided by an embodiment of the present application for screening target test cases by a use case management system to implement automated testing may include:
[0063] S201: Obtain the target recipe file corresponding to the current build of the embedded operating system.
[0064] Similar to the above embodiment, the use case management system first needs to obtain the current BB file corresponding to the current build of the embedded OS, and then determine the function module to be tested by directly obtaining the BB file from the memory of the build system, thereby improving the accuracy of determining the function module to be tested.
[0065] S202: Determine the function module to be tested corresponding to the current build based on the target recipe file, where the function module to be tested is a function module of the embedded operating system that has been modified compared to the last build.
[0066] Similar to the above embodiment, the use case management system first determines the changed data from the BB file directly through data analysis based on the correspondence between the functional modules and the data, and then determines the functional modules to be tested according to the changed data, thereby improving the accuracy of determining the functional modules to be tested.
[0067] S203: Determine a label corresponding to the functional module to be tested; determine a target test case corresponding to the functional module to be tested according to the label; the label is used to indicate the functional module corresponding to each test case.
[0068] The difference is that the concept of labels is introduced in this embodiment. By setting labels for target test cases in advance, the use case management system can more accurately determine the target test cases. Specifically, labels are used to indicate the functional modules corresponding to each test case. In order to better distinguish, the test cases can be named according to the functional modules corresponding to the test cases during setting. In combination with the above example, there are functional modules X, Y and Z, and test cases A and B are designed for testing. If you want to make test case A correspond to functional module X, and make test case B correspond to functional module Y and functional module Z during design. Then the label corresponding to test case A can be directly named "functional module X", and the label corresponding to test case B can be directly named "functional module Y+functional module Z". In this way, if the use case management system determines that function module X is the function module to be tested, the label including the function module X strip (the label "function module X" of test case A) can be selected from the label list as the label corresponding to the function module to be tested; if the use case management system determines that function module Y and / or function module Z are the function modules to be tested, the label including the function module Y and / or function module Z strip (the label "function module Y+function module Z" of test case B) can be selected from the label list as the label corresponding to the function module to be tested. Then, the step of screening test cases can be performed by the use case management system. Specifically, after the use case management system determines the label corresponding to the function module to be tested, the test case corresponding to the label can be directly determined according to the one-to-one mapping relationship between the label and the test case, thereby achieving the purpose of the use case management system determining the target test case according to the label. In this way, after determining the function module to be tested, the target test case is determined in combination with the label, which improves the accuracy of screening the target test case.
[0069] S204: Send the target test case to an execution machine, so that the execution machine uses the target test case to test the embedded operating system.
[0070] In actual applications, the target test case determined by the label in the above-mentioned use case management system is sent to the execution machine, and the execution machine uses the target test case to test the built embedded OS. Continuing with the above example, the label corresponding to test case A is "Functional Module X", and the label corresponding to test case B is "Functional Module Y + Functional Module Z". If the use case management system determines that functional module X is the functional module to be tested, the label "Functional Module X" of test case A can be determined as the label corresponding to the functional module to be tested based on field identification, and test case A can be determined as the target test case through the label, and test case A is sent to the execution machine to test the embedded OS. In this way, the test accuracy of the embedded operating system is improved.
[0071] In addition, since the methods for determining the label corresponding to the functional module to be tested are not the same, the embodiment of the present application can illustrate a possible determination method.
[0072] In one case, determining a label corresponding to the functional module to be tested includes:
[0073] Determine a label corresponding to the functional module to be tested based on a preset label field;
[0074] The label field includes function modules, labels, and the corresponding relationship between the function modules and the labels.
[0075] In actual applications, a label field can be added to the use case management system, which records the correspondence between each functional module and each label. After the use case management system determines the functional module to be tested, it can search for the label corresponding to the functional module in the label field, thereby achieving the purpose of quickly determining the label corresponding to the functional module to be tested, thereby improving the testing efficiency of the embedded operating system.
[0076] In summary, the embodiment of the present application provides a method for implementing automated testing by screening target test cases by a use case management system, first obtaining the target recipe file corresponding to the current construction of the embedded operating system. Then, the functional module to be tested corresponding to the current construction is determined based on the target recipe file, and the functional module to be tested is the functional module of the embedded operating system that has been changed compared to the previous construction. Finally, the label corresponding to the functional module to be tested is determined; the target test case corresponding to the functional module to be tested is determined according to the label; the label is used to indicate the functional module corresponding to each test case, and the target test case is sent to the execution machine, so that the execution machine uses the target test case to test the embedded operating system. In this way, the functional module that has been changed in the current construction of the embedded operating system is determined by the recipe file, and the target test case corresponding to it is determined in combination with the label, and then the target test case is used for testing, so that the embedded operating system is tested in a targeted manner without manual intervention, thereby improving the test efficiency of the embedded operating system. In addition, based on the different subjects of screening target test cases, the embodiment of the present application provides another implementation method for explanation.
[0077] Figure 3 A flowchart of a method for implementing automated testing by screening target test cases using an automated testing framework is provided in an embodiment of the present application. Figure 2 As shown, a method provided by an embodiment of the present application for implementing automated testing by screening target test cases using an automated testing framework may include:
[0078] S301: Obtain the target recipe file corresponding to the current build of the embedded operating system.
[0079] S302: Determine the function module to be tested corresponding to the current build based on the target recipe file, where the function module to be tested is a function module of the embedded operating system that has been modified compared to the last build.
[0080] In practical applications, S201-S202 in the above embodiment are the same as S301-S302 in this embodiment, and are not described in detail here.
[0081] S303: Determine a label corresponding to the functional module to be tested; send the label to an execution machine, so that the execution machine filters out corresponding target test cases according to the label; the label is used to indicate the functional module corresponding to each test case.
[0082] In practical applications, the same as the above embodiment is that the concept of labels is continued to be introduced, and labels are set for target test cases in advance, so that the use case management system can determine the target test cases more accurately. The difference is that the step of screening test cases is performed by the execution machine. Specifically, in the automation script (shell) file in the automated test framework, a label statement is added to indicate the one-to-one mapping relationship between the label and the test case. After the use case management system determines the label corresponding to the functional module to be tested, the label can be sent directly to the automated test framework, and the framework directly identifies and screens out the target test case (the test case that should be executed) through the label when executing the test. In this way, the working pressure of the use case management system is reduced, and the test efficiency and stability of the embedded operating system are improved.
[0083] S304: Based on the execution machine, the embedded operating system is tested using the target test case selected by the execution machine.
[0084] In practical applications, combined with the above, the execution machine selects the target test case, and then uses the target test case to test the built embedded OS. In this way, the work pressure of the case management system is reduced and the test efficiency and stability of the embedded operating system are improved.
[0085] As above, Figure 4 A schematic diagram of an automated testing system framework for an embedded operating system provided in an embodiment of the present application, combined with Figure 4As shown in the figure, when the embedded OS is built, the use case management system first obtains the BB file generated by this build and compares it with the BB file generated by the previous build, and obtains the patch file updated by this build. Then, the functional modules that have changed in this build are identified by analyzing the file name or file content, and the label name is obtained through the mapping relationship. Finally, the use case management system selects test cases according to the labels and sends the selected cases to the execution machine to perform automated testing; or the use case management system sends the labels to the execution machine, directly pulls up the automated testing, and the test framework executes the corresponding test cases according to the labels, and implements automated testing. The entire process performs targeted testing on the embedded OS without the need for human intervention, thereby improving the testing efficiency of the embedded operating system.
[0086] In summary, the embodiment of the present application first obtains the target recipe file corresponding to the current construction of the embedded operating system. Then obtain the target recipe file corresponding to the current construction of the embedded operating system. Finally, determine the label corresponding to the functional module to be tested, send the label to the execution machine, so that the execution machine filters out the corresponding target test case according to the label, and based on the execution machine, use the target test case filtered by the execution machine to test the embedded operating system. Wherein, the label is used to indicate the functional module corresponding to each test case. In this way, the functional module of the embedded operating system that has been modified in this construction is determined by the recipe file, and the target test case corresponding to it is determined based on the execution machine and the label, and then the target test case is used for testing, so as to carry out targeted testing on the embedded operating system without manual intervention, and it is not necessary to use all the test cases in the library to test it after each construction of the embedded operating system, and it also avoids the problem of wasting time and easy omissions in manually selecting test cases, which reduces the working pressure of the case management system and improves the testing efficiency of the embedded operating system.
[0087] Based on the automated testing method of an embedded operating system provided in the above embodiment, the embodiment of the present application further provides an automated testing device of an embedded operating system. The automated testing device of an embedded operating system is described below in conjunction with the embodiments and drawings.
[0088] Figure 5 A schematic diagram of the structure of an automated testing device for an embedded operating system provided in an embodiment of the present application. Figure 5 As shown, the automatic testing device 500 for an embedded operating system provided in an embodiment of the present application includes:
[0089] The acquisition module 501 is used to acquire the target recipe file corresponding to the current construction of the embedded operating system;
[0090] A first determination module 502 is used to determine the function module to be tested corresponding to the current build based on the target recipe file, wherein the function module to be tested is a function module of the embedded operating system that has been modified compared to the last build;
[0091] A second determination module 503 is used to determine the target test case corresponding to the function module to be tested based on a preset corresponding relationship;
[0092] The testing module 504 is used to test the embedded operating system based on the target test case.
[0093] As an implementation manner, with respect to how to determine the functional module to be tested according to the target recipe file, the first determination module 502 specifically includes: a comparison module and a first determination submodule;
[0094] A comparison module is used to compare the target recipe file with the original recipe file to determine the patch file generated by this build; the original recipe file is the BB file recorded in the last build of the embedded operating system;
[0095] The first determination submodule is used to determine the function module to be tested in the embedded operating system according to the patch file.
[0096] As an implementation manner, with respect to how to determine the functional module to be tested according to the patch file, the first determination submodule is specifically used to:
[0097] Read the file name of the patch file;
[0098] Based on the keyword extraction technology, the function module to be tested corresponding to the embedded operating system is identified from the file name.
[0099] As another implementation manner, with respect to how to determine the functional module to be tested according to the patch file, the first determination submodule is further specifically used for:
[0100] Open the patch file;
[0101] The file content of the patch file is parsed, and the function module to be tested corresponding to the embedded operating system is identified from the file content based on a keyword extraction technology.
[0102] As an implementation method, with respect to how to determine the target test case corresponding to the functional module to be tested, the second determination submodule 503 specifically includes: a second determination submodule and a third determination submodule.
[0103] A second determination submodule, used to determine a label corresponding to the functional module to be tested;
[0104] A third determination submodule is used to determine a target test case corresponding to the functional module to be tested according to the label;
[0105] Labels are used to indicate the functional modules corresponding to each test case.
[0106] As an implementation method, regarding how to use the target test case to test the embedded operating system, the test module 504 is specifically used to:
[0107] The target test case is sent to an execution machine, so that the execution machine uses the target test case to test the embedded operating system.
[0108] As an implementation mode, with respect to how to use the target test case to test the embedded operating system, the third determination submodule is further specifically used for:
[0109] The tag is sent to the execution machine, so that the execution machine filters out the corresponding target test case according to the tag.
[0110] As an implementation method, regarding how to use the target test case to test the embedded operating system, the test module 504 is further specifically used for:
[0111] Based on the execution machine, the embedded operating system is tested using the target test cases screened by the execution machine.
[0112] As an implementation manner, with respect to how to determine a label corresponding to a functional module to be tested, the second determination submodule is specifically configured to:
[0113] Determine a label corresponding to the functional module to be tested based on a preset label field;
[0114] The label field includes function modules, labels, and the corresponding relationship between the function modules and the labels.
[0115] In summary, the embodiment of the present application first obtains the target recipe file corresponding to the current build of the embedded operating system. Then, the functional module to be tested corresponding to the current build is determined based on the target recipe file. Among them, the functional module to be tested is the functional module of the embedded operating system that has been changed compared to the previous build. Finally, based on the preset corresponding relationship, the target test case corresponding to the functional module to be tested is determined, and the embedded operating system is tested based on the target test case. In this way, the functional module of the embedded operating system that has been changed in this build is determined through the recipe file, and then the corresponding test case is used for testing, so that the embedded operating system is tested in a targeted manner without manual intervention, thereby improving the testing efficiency of the embedded operating system.
[0116] In addition, the present application also provides a server, comprising: a memory for storing a computer program; and a processor for implementing the steps of the above-mentioned automated testing method for an embedded operating system when executing the computer program.
[0117] In addition, the present application also provides a readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the automated testing method for the embedded operating system are implemented.
[0118] Figure 6 A schematic diagram of the structure of a BMC provided in an embodiment of the present application. Figure 6 As shown, it includes an Ethernet interface, a virtual chassis engine (Virtual Chassis Engine, VCE), a graphics processing unit (Graphic Processing Unit, GPU), a display interface and various other IO interface groups, such as IO interface group 1, IO interface group 2 and IO interface group N, etc. Among them, the Ethernet interface can be used as a management network port to remotely manage the server and perform remote display through the network. VCE also interacts with the GPU to manage and control the devices in the virtual chassis. The GPU is used to process graphics and image calculations. The display interface can be used as a VGA interface to connect the computer and the display. Through this interface for local display, the user can monitor the status of the server, remotely manage the server and perform fault diagnosis. In addition, other IO interface groups may include serial port interfaces and USB interfaces, etc., which are respectively connected to corresponding server nodes. The serial port interface is used for low-level communication with the server, especially during system startup or fault diagnosis; the USB interface is used to connect Ge Zheng USB devices.
[0119] Figure 7 A schematic diagram of a server structure provided in an embodiment of the present application, combined with Figure 7 As shown, the server 700 includes a processor 710 and a memory 720; wherein the memory 720 stores computer instructions, and the processor 710 is used to execute the computer instructions, so that the server 700 executes the automated testing method of the embedded operating system based on the DBUS interface shown above.
[0120] In some embodiments, the processor 710 may be a CPU, a BMC, or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. A general-purpose processor may be a microprocessor or any conventional processor.
[0121] In some embodiments, the memory 720 may be a volatile memory or a non-volatile memory, such as a register. Specifically, a volatile memory refers to a memory in which the data stored inside will be lost when the power supply is interrupted. Among them, the volatile memory is mainly a random access memory (RAM), including a static random access memory (SRAM) and a dynamic random access memory (DRAM). A non-volatile memory refers to a memory in which the data stored inside will not be lost even if the power supply is interrupted. Common non-volatile memories include read-only memory (ROM), optical disks, magnetic disks, solid-state hard disks, and various memory cards based on flash memory technology.
[0122] In some embodiments, the memory 720 has executable code, and the memory 720 executes the code to implement an automated testing method for an embedded operating system based on a DBUS interface.
[0123] The communication interface 730 is used for communicating with the outside. For example, the communication interface 730 serves as an external interface, and the external interface receives a request to create a virtual machine. The communication interface 730 can also receive various parameters required to create the virtual machine.
[0124] The bus can be a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of understanding, Figure 7 It is represented by only one thick line, but it does not mean that there is only one bus or one type of bus.
[0125] It should be understood that the above-mentioned servers are only schematic representations. In actual use, the above-mentioned servers can be independent physical servers, or they can be server clusters or distributed systems composed of multiple physical servers. They can also be cloud servers that provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), as well as basic cloud computing services such as large databases and artificial intelligence platforms. When the above-mentioned servers are server clusters or distributed systems composed of multiple physical servers, multiple physical servers can form a blockchain, and each physical server is a node on the blockchain. The physical type of the service area can be a rack server, a high-density server, a GPU server, a tower server, and can also be a blade server, a whole cabinet server, etc., which is not specifically limited in this application.
[0126] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. An automated testing method for an embedded operating system, characterized in that: The method comprises: Get the target recipe file corresponding to the current build of the embedded operating system; Determine the function module to be tested corresponding to the current build based on the target recipe file, the function module to be tested being a function module of the embedded operating system that has been modified compared to the last build; Based on the preset corresponding relationship, determine the target test case corresponding to the functional module to be tested; The embedded operating system is tested based on the target test case.
2. The method according to claim 1, characterized in that: The determining the functional module to be tested corresponding to the current construction based on the target recipe file includes: Compare the target recipe file with the original recipe file to determine the patch file generated by this build; the original recipe file is the BB file recorded in the last build of the embedded operating system; The function module to be tested in the embedded operating system is determined according to the patch file.
3. The method according to claim 2, characterized in that The step of determining the function module to be tested in the embedded operating system according to the patch file includes: Read the file name of the patch file; Based on the keyword extraction technology, the function module to be tested corresponding to the embedded operating system is identified from the file name.
4. The method according to claim 2, characterized in that: The step of determining the function module to be tested in the embedded operating system according to the patch file includes: Open the patch file; The file content of the patch file is parsed, and the function module to be tested corresponding to the embedded operating system is identified from the file content based on a keyword extraction technology.
5. The method according to claim 1, characterized in that The step of determining the test case corresponding to the functional module to be tested comprises: Determine a label corresponding to the functional module to be tested; Determine a target test case corresponding to the functional module to be tested according to the label; Labels are used to indicate the functional modules corresponding to each test case.
6. The method according to claim 5, characterized in that The testing of the embedded operating system based on the target test case includes: The target test case is sent to an execution machine, so that the execution machine uses the target test case to test the embedded operating system.
7. The method according to claim 5, characterized in that The step of determining a target test case corresponding to the functional module to be tested according to the label includes: The tag is sent to the execution machine, so that the execution machine filters out the corresponding target test case according to the tag.
8. The method according to claim 7, characterized in that The testing of the embedded operating system based on the target test case includes: Based on the execution machine, the embedded operating system is tested using the target test cases screened by the execution machine.
9. The method according to claim 5, characterized in that The determining of the label corresponding to the functional module to be tested includes: Determine a label corresponding to the functional module to be tested based on a preset label field; The label field includes function modules, labels, and the corresponding relationship between the function modules and the labels.
10. A server, characterized in that: include: Memory for storing computer programs; A processor, used to implement the steps of the automated testing method for an embedded operating system as claimed in any one of claims 1 to 9 when executing the computer program.
Citation Information
Patent Citations
Regression test method and device, computer equipment and storage medium
CN114201408A
Test method and device based on test case identification, electronic equipment and medium
CN117215965A
System and method for implementing a test optimization module
US10922214B1
Cited By
Firmware testing method, electronic equipment, storage medium and program product
CN119829469A
