Test method, device, electronic device, and storage medium
By configuring and renaming symbolic interface functions in the virtual driver module, the problem of devices being unable to find symbolic interfaces in Google Mobile Services testing was resolved, achieving test stability and rapid pass, and improving the adaptability and stability of the devices.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-30
- Publication Date
- 2026-04-07
AI Technical Summary
The device failed to find the symbolic interface during Google Mobile Services testing, causing the test to fail.
The symbolic interface functions required for running the test are pre-configured in the virtual driver module, renamed, and copied to the virtual driver module. After the device driver module is loaded, it calls these symbolic interface functions from the virtual driver module.
This avoids test failures caused by the inability to find symbolic interfaces during mobile service testing, ensuring test stability and rapid completion, saving development time, and guaranteeing the normal use of the current kernel version of the device and the stability of subsequent upgrades.
Smart Images

Figure CN116185840B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a testing method, apparatus, electronic device, and storage medium. Background Technology
[0002] Starting with Android 11, Google introduced a new platform architecture with a universal kernel image. By unifying the core kernel and separating board-level peripherals as dynamically loadable modules from the kernel, both peripheral modules and the kernel can be updated independently, thus solving the kernel fragmentation problem. Google requires all devices using Android 11 and later versions to use the universal kernel image provided by Google to run Google Mobile Services tests.
[0003] However, the kernel version used for Google Mobile Services testing is a stable or frozen version, which does not include all symbols in the kernel and is also outdated compared to the kernel version currently used for Android device development. Therefore, Android devices often encounter problems where symbol interfaces cannot be found, leading to test failures when testing Google Mobile Services. Summary of the Invention
[0004] The purpose of this invention is to solve the above-mentioned problems and provide a testing method, apparatus, electronic device and storage medium, which solves the problem that the device cannot find the symbol interface when performing mobile service testing, thus causing the test to fail and ensuring that the device can quickly pass the mobile service test.
[0005] To address the aforementioned issues, embodiments of this application provide a testing method, comprising: loading a pre-configured virtual driver module; wherein the virtual driver module includes: symbolic interface functions required for running mobile service testing; loading a pre-configured device driver module, and calling the symbolic interface functions required by the device driver module from the virtual driver module; and executing mobile service testing.
[0006] To address the aforementioned issues, embodiments of this application provide a testing apparatus, comprising: a loading module for loading a pre-configured virtual driver module; wherein the virtual driver module includes symbolic interface functions required for running mobile service tests; a calling module for loading a pre-configured device driver module and calling the symbolic interface functions required by the device driver module from the virtual driver module; and a testing module for executing the mobile service tests.
[0007] To address the aforementioned problems, embodiments of this application also provide an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the aforementioned test method.
[0008] To address the aforementioned issues, embodiments of this application also provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the aforementioned testing method.
[0009] The testing method provided in this application pre-loads the symbolic interface functions required for running the test system into the virtual driver module. After the virtual driver module and the device driver module are loaded, the device driver module can directly call the symbolic interface functions from the virtual driver module according to the test requirements. This avoids the problem of mobile service test failure due to the inability to find the symbolic interface when the device is performing mobile service test, ensuring the stable operation of the mobile service test system and ensuring that the device can quickly pass the mobile service test.
[0010] In some embodiments, the configuration process of the virtual driver module includes: renaming the symbolic interface functions required to run the mobile service test; copying the renamed symbolic interface functions to the virtual driver module; declaring the renamed symbolic interface functions as globally usable; renaming the symbolic interface functions avoids conflicts with device kernel symbol definitions; declaring the symbolic interface functions as globally usable ensures that functions in the virtual driver module can be called by device driver functions.
[0011] In some embodiments, the configuration process of the device driver module includes: replacing the symbol names in the device driver module with the renamed symbol names according to the renaming results of the symbol interface functions in the virtual driver module, and replacing the symbol names in the device driver module according to the renaming results in the virtual driver module, thereby ensuring the consistency of symbol names.
[0012] In some embodiments, the number of device driver modules is greater than 1, and loading a pre-configured device driver module includes: loading the corresponding device driver module according to the test requirements.
[0013] In some embodiments, both the virtual driver module and the device driver module are located in the vendor partition. Attached Figure Description
[0014] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.
[0015] Figure 1 This is a flowchart of a testing method provided in an embodiment of this application;
[0016] Figure 2 This is a schematic diagram of the structure of a testing device provided in an embodiment of this application;
[0017] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the various embodiments of this application will be described in detail below with reference to the accompanying drawings. However, those skilled in the art will understand that many technical details have been presented in the various embodiments of this application to enable the reader to better understand this application. However, the technical solutions claimed in this application can be implemented even without these technical details and various changes and modifications based on the following embodiments.
[0019] One embodiment of this application relates to a testing method, comprising: loading a pre-configured virtual driver module; wherein the virtual driver module includes: symbolic interface functions required for running mobile service testing; loading a pre-configured device driver module, calling the symbolic interface functions required by the device driver module from the virtual driver module; and executing mobile service testing. This solves the problem that the device fails to find symbolic interfaces during mobile service testing, thus ensuring that the device quickly passes the mobile service test.
[0020] The implementation details of the testing method in this embodiment are described below. This content is only for understanding the implementation details of this solution and is not essential for implementing it. The specific process is as follows: Figure 1 As shown, the steps may include the following:
[0021] In step 101, a pre-configured virtual driver module is loaded; wherein, the virtual driver module includes symbolic interface functions required to run the mobile service test.
[0022] In one example, the kernel of the mobile service test system is started, and a pre-configured virtual driver module is loaded. The configured virtual driver module includes symbolic interface functions that are missing in the kernel and required to run the mobile service test system, which can be called by other device driver modules from the virtual driver module.
[0023] In this embodiment of the application, the configuration process of the virtual driver module includes: renaming the symbolic interface functions required for running mobile service tests; copying the renamed symbolic interface functions to the virtual driver module; and declaring the renamed symbolic interface functions as globally usable.
[0024] In one example, a virtual driver google_gki_miss_symbol.ko is added to the Google Mobile Services test system. This virtual driver is configured as a module and not compiled into the kernel. In other words, a virtual driver is added and compiled into a module and dynamically loaded in the vendor partition as a supplement to the Google kernel module interface.
[0025] In one example, all missing symbolic interface functions from the Google Mobile Services test are renamed, copied into the virtual driver module, and exported via EXPORT_SYMBOL to declare the functions as globally usable for other device driver modules to call.
[0026] In step 102, the pre-configured device driver module is loaded, and the symbolic interface functions required by the device driver module are called from the virtual driver module.
[0027] In one example, after the virtual driver module is loaded, the device driver module is loaded. Since the device driver module needs to call symbolic interface functions that are not in the kernel, the required symbolic interface functions are called from the virtual driver module to complete the mobile service test of the device.
[0028] In this embodiment of the application, the configuration process of the device driver module includes: replacing the symbol name in the device driver module with the renamed symbol name according to the renaming result of the symbol interface function in the virtual driver module.
[0029] In one example, a device driver with a missing symbolic interface is configured as a module. The device driver module is also not compiled into the kernel. Here, a device driver with a missing symbolic interface is a device driver for which the required symbolic interface cannot be found in the kernel. The initialization priority of the device driver module is lower than that of the virtual driver module. For example, using late_initcall can ensure that the device driver module is loaded after the virtual driver module is loaded.
[0030] In one example, since the symbolic interface functions in the virtual driver module have all been renamed, in order to ensure the consistency of symbolic names, the symbolic names in the device driver module are replaced with the renamed symbols in the virtual driver module according to the changed symbolic names in the virtual driver module.
[0031] In one example, missing symbols in the driver module are replaced with renamed symbols in the virtual driver module. When performing mobile service testing on the device, the driver module accesses the function interface in the virtual driver module through the extern modifier and calls the symbol interface function in the virtual driver module.
[0032] In this embodiment of the application, the number of device driver modules is greater than 1, and loading a pre-configured device driver module includes: loading the corresponding device driver module according to the test requirements.
[0033] In one example, three device driver modules lacking symbolic interfaces were added to the mobile service testing system. Device driver module A, device driver module B, and device driver module C correspond to the device input, display, and shooting functions, respectively. The current mobile service testing system needs to test the device's shooting function. Therefore, based on the virtual driver module already loaded, the device driver module C corresponding to the shooting function is loaded to perform subsequent shooting function testing.
[0034] In step 103, a mobile service test is performed.
[0035] In one example, after the virtual module and the device driver module are loaded, the device driver module calls the symbolic interface functions required by the virtual driver module, thus enabling the device to successfully pass the test.
[0036] To make the testing method provided in this application's embodiments clearer, the following example illustrates the method in detail. In one example, when the device is performing mobile service testing, the device driver module D cannot find the symbolic interfaces for the symbols `i2c_match_id` and `devm_i2c_new_dummy_device` in the Google kernel. The symbolic interface functions for `i2c_match_id` and `devm_i2c_new_dummy_device` are renamed and copied to the virtual driver module. The device driver module A accesses the function interfaces in the virtual driver module through the `extern` modifier, thereby enabling it to call the symbolic interface functions for `i2c_match_id` and `devm_i2c_new_dummy_device`.
[0037] The testing method provided in this application pre-names and copies the missing symbolic interface functions in the mobile service test kernel to the virtual driver module. After the virtual driver module and the device driver module are loaded, the device driver module can directly call the corresponding symbolic interface functions from the virtual driver module according to the test requirements. This avoids the problem of mobile service test failure due to the inability to find symbolic interfaces when the device is performing mobile service testing. Furthermore, the testing method provided in this proposal is applicable to many scenarios, has strong adaptability, and has a very flexible architecture design. It can ensure that the device can quickly pass the mobile service test, saving the project development cycle, and also ensure that the current kernel version of the device can be used normally by users. At the same time, it improves the stability of subsequent device upgrades to a certain extent.
[0038] The steps of the various methods described above are only for clarity. In practice, they can be combined into one step or some steps can be split into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this patent. Adding insignificant modifications or introducing insignificant designs to the algorithm or process, but without changing the core design of the algorithm and process, are also within the scope of protection of this patent.
[0039] This application also relates to a testing device, such as... Figure 2 As shown, it includes: loading module 201, calling module 202, and testing module 203.
[0040] Specifically, the loading module 201 is used to load a pre-configured virtual driver module; wherein the virtual driver module includes: symbolic interface functions required to run mobile service tests; the calling module 202 is used to load a pre-configured device driver module and call the symbolic interface functions required by the device driver module from the virtual driver module; and the testing module 203 is used to execute mobile service tests.
[0041] In one example, the kernel of the mobile service test system is started, and the loading module 201 loads the pre-configured virtual driver module. The configured virtual driver module includes symbolic interface functions that are missing in the kernel and required to run the mobile service test system, which can be called by other device driver modules from the virtual driver module.
[0042] In one example, the aforementioned test setup also includes a processing module that renames all missing symbolic interface functions from the Google Mobile Services test, copies them to the virtual driver module, and exports them via EXPORT_SYMBOL to declare the functions as globally usable for other device driver modules to call.
[0043] In one example, after the virtual driver module is loaded, the device driver module is loaded. Since the device driver module needs to call symbolic interface functions that are not in the kernel, module 202 calls the required symbolic interface functions from the virtual driver module to complete the mobile service test of the device.
[0044] It is not difficult to see that this embodiment is a device embodiment corresponding to the above-described test method embodiments, and this embodiment can be implemented in conjunction with the above-described test method embodiments. The relevant technical details mentioned in the above-described test method embodiments are still valid in this embodiment, and will not be repeated here to reduce repetition. Correspondingly, the relevant technical details mentioned in this embodiment can also be applied to the above-described test method embodiments.
[0045] The testing apparatus provided in this application pre-names and copies the missing symbolic interface functions in the mobile service testing kernel to the virtual driver module. After loading the virtual driver module and the device driver module, the device driver module can directly call the corresponding symbolic interface functions from the virtual driver module according to the testing requirements. This avoids the problem of mobile service testing failing due to the inability to find symbolic interfaces. Furthermore, the testing method provided in this proposal is applicable to many scenarios, highly adaptable, and has a very flexible architecture design. It can ensure that the device quickly passes the mobile service test, saving the project development cycle, and also ensure that the current kernel version of the device can be used normally by users. At the same time, it improves the stability of subsequent device upgrades to a certain extent.
[0046] It is worth mentioning that all modules involved in the above embodiments of this application are logical modules. In practical applications, a logical unit can be a physical unit, a part of a physical unit, or a combination of multiple physical units. Furthermore, to highlight the innovative aspects of this application, this embodiment does not introduce units that are not closely related to solving the technical problem proposed in this application; however, this does not mean that other units are absent from this embodiment.
[0047] Embodiments of this application also provide an electronic device, such as... Figure 3 As shown, it includes at least one processor 301; and a memory 302 communicatively connected to the at least one processor 301; wherein the memory 302 stores instructions executable by the at least one processor 301, the instructions being executed by the at least one processor 301 to enable the at least one processor to perform the above-described test method.
[0048] The memory and processor are connected via a bus, which can include any number of interconnecting buses and bridges, connecting various circuits of one or more processors and memories. The bus can also connect various other circuits, such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and will not be described further herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be a single element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices over a transmission medium. Data processed by the processor is transmitted over the wireless medium via an antenna, which further receives data and transmits it to the processor.
[0049] The processor manages the bus and general processing, and also provides various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Memory is used to store data used by the processor during operation.
[0050] The above-mentioned products can perform the methods provided in the embodiments of this application, and have the corresponding functional modules and beneficial effects of performing the methods. For technical details not described in detail in this embodiment, please refer to the methods provided in the embodiments of this application.
[0051] Embodiments of this application also provide a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the above-described method embodiments.
[0052] Those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing related hardware. This program is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0053] The above embodiments are provided for those skilled in the art to implement and use this application. Those skilled in the art can make various modifications or changes to the above embodiments without departing from the inventive concept of this application. Therefore, the protection scope of this application is not limited to the above embodiments, but should conform to the maximum scope of the innovative features mentioned in the claims.
Claims
1. A testing method, characterized in that, include: Load a pre-configured virtual driver module; wherein, the virtual driver module includes: symbolic interface functions that are missing in the kernel and required to run mobile service tests, which can be called by other device driver modules from the virtual driver module; Load the pre-configured device driver module, and call the symbolic interface functions required by the device driver module from the virtual driver module; Perform the mobile service test; The configuration process of the virtual driver module includes: renaming the symbolic interface functions required to run the mobile service test; copying the renamed symbolic interface functions to the virtual driver module; and declaring the renamed symbolic interface functions as globally usable. The configuration process of the device driver module includes: replacing the symbol names in the device driver module with the renamed symbol names according to the renaming results of the symbol interface functions in the virtual driver module.
2. The test method according to claim 1, characterized in that, The number of device driver modules is greater than 1, and loading the pre-configured device driver modules includes: Load the corresponding device driver module according to the test requirements.
3. The test method according to any one of claims 1-2, characterized in that, Both the virtual driver module and the device driver module are located in the vendor partition.
4. A testing device, characterized in that, include: A loading module is used to load a pre-configured virtual driver module; wherein, the virtual driver module includes symbolic interface functions required to run mobile service tests; The calling module is used to load the pre-configured device driver module and call the symbolic interface functions required by the device driver module from the virtual driver module; The testing module is used to perform the mobile service tests. The configuration process of the virtual driver module includes: renaming the symbolic interface functions required to run the mobile service test; copying the renamed symbolic interface functions to the virtual driver module; and declaring the renamed symbolic interface functions as globally usable. The configuration process of the device driver module includes: replacing the symbol names in the device driver module with the renamed symbol names according to the renaming results of the symbol interface functions in the virtual driver module.
5. An electronic device, characterized in that, include: At least one processor; as well as, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the test method as described in any one of claims 1 to 3.
6. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the test method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Equipment virtualization test platform, method and device for magnetic resonance system
CN115470136A