Equipment firmware packaging test method and device, electronic equipment and storage medium
The webhook notification is triggered through the git service, the development platform generates packaging instructions, compiles the service to package and restarts the device, and automatically tests the test service, solving the problem of cumbersome firmware testing of the device, realizing a fully automated process, and improving efficiency.
Patent Information
- Application Number
- CN202411247941.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-06
- Publication Date
- 2024-12-17
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The firmware testing process of existing equipment is cumbersome and requires manual repeated operations, resulting in long time and inefficiency.
The webhook notification is triggered through the git service, the development platform generates packaging instructions, compiles the service to package firmware code and controls the device to restart, and the test service automatically conducts testing to achieve a fully automated process.
It saves manual packaging, shortens the test cycle, improves the testing efficiency, and replaces some repeated regression testing work of hardware devices.
Smart Images

Figure CN119149419A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of firmware testing technology, and in particular to a device firmware packaging testing method, device, electronic device and storage medium. Background Art
[0002] With the development of the testing industry, the automation technology in software testing has become quite mature, including various automated testing platforms, such as metersphere, etc. For the software products they develop, various companies can use relevant technical means to achieve automated testing in all aspects, from unit testing, integration testing, and acceptance testing. However, since hardware testing involves specific physical devices and different models of devices have different communication protocols, for many companies, how to automate the process of device hardware testing has become an urgent problem to be solved.
[0003] The existing test for device firmware requires manually packaging the firmware package, then logging into the device backend, pulling the firmware package through FTP, decompressing and updating, and performing the test. During the test of a device, such operations need to be performed repeatedly by humans, which is a cumbersome process and requires a large number of repeated tests by humans, which takes a long time and is inefficient. Summary of the invention
[0004] The present invention provides a device firmware packaging test method, device, electronic device and storage medium, which are used to solve the technical problems that the existing firmware testing process is cumbersome, requires a large number of repeated tests manually, takes a long time and is inefficient.
[0005] The present invention provides a device firmware packaging test method, comprising:
[0006] The git service responds to the firmware code submitted by the firmware developer, triggers a webhook notification, and sends the webhook notification to the development platform;
[0007] The development platform obtains a packaging configuration according to the webhook notification, generates a packaging instruction according to the packaging configuration, and sends the packaging instruction to the compilation service;
[0008] The compiling service packages the firmware code according to the packaging instruction to obtain a firmware package;
[0009] After the packaging is completed, the compiling service logs in to the preset device background, and controls the device under test to obtain the firmware package and restart the device through the preset device background;
[0010] When the compilation service detects that the device under test has completed the device restart, it sends the test task to the test service;
[0011] The test service tests the device under test through the test task to obtain a test result.
[0012] Optionally, the step of the compilation service packaging the firmware code according to the packaging instruction to obtain a firmware package includes:
[0013] Obtain source code acquisition method, specified device type and packaging type from the packaging configuration;
[0014] Acquire the firmware code according to the source code acquisition method, generate an http request and a process log, and send the http request and the process log to the development platform, wherein the http request carries the current packaging progress, and the process log is cached in a preset database;
[0015] Modify the device type parameter in the configuration file of the firmware code according to the specified device type;
[0016] Clear the original compilation cache in the code directory of the modified firmware code, and execute the compilation command to obtain the firmware code compilation result;
[0017] The firmware code compilation result is packaged to generate a firmware package.
[0018] Optionally, the step of the compilation service logging into a preset device background after packaging is completed, and controlling the device under test to obtain the firmware package and restart the device through the preset device background, includes:
[0019] The compilation service logs into the preset device backend after packaging is completed, and obtains the device IP / port, login username / password from the packaging configuration;
[0020] Log in to the device under test according to the device IP / port and the login username / password;
[0021] After logging into the device under test, controlling the device under test to pull the firmware package to perform device update;
[0022] After the device is updated successfully, the device under test is controlled to restart.
[0023] Optionally, when the compilation service detects that the device under test has completed device restart, the step of sending the test task to the test service includes:
[0024] When the compilation service detects that the device under test has completed the device restart, the device IP, device type, quality inspection board IP, and firmware version number are obtained from the package configuration;
[0025] Generate a task generation request using the device IP, the device type, the quality inspection board IP and the firmware version number;
[0026] The task generation request is sent to the test service to generate a test task.
[0027] Optionally, the step of the test service testing the device under test through the test task to obtain the test result includes:
[0028] Establish a connection with the quality inspection board according to the quality inspection board IP;
[0029] Obtaining the protocol type supported by the device under test according to the device IP;
[0030] Start the corresponding device service according to the protocol type;
[0031] Obtain the test device type and test firmware version number of the device under test;
[0032] Comparing the test device type with the device type, and the test firmware version number with the firmware version number to see if they are the same;
[0033] If they are the same, load the test case, and after the device under test is restarted, establish a connection between the device service and the device under test;
[0034] According to the test case, a test instruction is sent to the device under test and the quality inspection board through the device service, wherein the test instruction is used for data interaction between the quality inspection board and the device under test;
[0035] Receiving result information returned by the quality inspection board and the device under test in response to the test instruction;
[0036] The result information is compared with the expected result to obtain the test result.
[0037] The present invention also provides a device firmware packaging test device, comprising:
[0038] The git service is used to respond to the firmware code submitted by the firmware developer, trigger the webhook notification, and send the webhook notification to the development platform;
[0039] A development platform, configured to obtain a packaging configuration according to the webhook notification, generate a packaging instruction according to the packaging configuration, and send the packaging instruction to a compilation service;
[0040] A compiling service is used to package the firmware code according to the packaging instruction to obtain a firmware package; it is also used to log in to the preset device background after the packaging is completed, and control the device under test to obtain the firmware package and restart the device through the preset device background; it is also used to send a test task to the testing service when it is detected that the device under test has completed the device restart;
[0041] The test service is used to test the device under test through the test task and obtain the test result.
[0042] Optionally, the compilation service includes:
[0043] A source code acquisition method, a specified device type, and a packaging type acquisition module, used to acquire a source code acquisition method, a specified device type, and a packaging type from the packaging configuration;
[0044] A firmware code acquisition module, used to acquire the firmware code according to the source code acquisition method, and generate an http request and a process log, and send the http request and the process log to the development platform, wherein the http request carries the current packaging progress, and the process log is cached in a preset database;
[0045] A device type parameter modification module, used to modify the device type parameter in the configuration file of the firmware code according to the specified device type;
[0046] A compiling module, used to clear the original compiling cache in the code directory of the modified firmware code, and execute the compiling command to obtain the firmware code compiling result;
[0047] The firmware package generation module is used to package the firmware code compilation result to generate a firmware package.
[0048] Optionally, the compilation service further includes:
[0049] The device IP / port, login username / password acquisition module is used for the compilation service to log in to the preset device background after packaging is completed, and obtain the device IP / port, login username / password from the packaging configuration;
[0050] A login module, used to log in to the device under test according to the device IP / port and the login username / password;
[0051] A device update module, used for controlling the device under test to pull the firmware package to perform device update after logging into the device under test;
[0052] The device restart module is used to control the device under test to restart the device after the device is successfully updated.
[0053] The present invention also provides an electronic device, the device comprising a processor and a memory:
[0054] The memory is used to store program code and transmit the program code to the processor;
[0055] The processor is used to execute the device firmware packaging test method as described in any one of the above items according to the instructions in the program code.
[0056] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store program code, and the program code is used to execute the device firmware packaging test method as described in any one of the above items.
[0057] It can be seen from the above technical scheme that the present invention has the following advantages: the present invention provides a device firmware packaging test method, and specifically discloses: the git service responds to the firmware code submitted by the firmware developer, triggers the webhook notification, and sends the webhook notification to the development platform; the development platform extracts the packaging configuration from the webhook notification, generates a packaging instruction according to the packaging configuration, and sends the packaging instruction to the compilation service; the compilation service packages the firmware code according to the packaging instruction to obtain a firmware package; the compilation service logs in to the preset device background after packaging is completed, and controls the device to be tested to obtain the firmware package through the preset device background to restart the device; when the compilation service detects that the device to be tested has completed the device restart, it sends a test task to the test service; the test service tests the device to be tested through the test task to obtain the test result. The present invention saves the manual packaging link by converting the device firmware testing process from manual to fully automatic, replaces part of the repeated regression testing work of the hardware device, shortens the test cycle, and improves the test efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0059] Figure 1 A flowchart of the steps of a device firmware packaging test method provided by an embodiment of the present invention;
[0060] Figure 2 A flowchart of a device firmware packaging test method provided by another embodiment of the present invention;
[0061] Figure 3 A schematic diagram of an automatic test process provided by an embodiment of the present invention;
[0062] Figure 4 A structural block diagram of a device firmware packaging test device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0063] The embodiments of the present invention provide a device firmware packaging test method, apparatus, electronic device and storage medium, which are used to solve the technical problems that the existing firmware testing process is cumbersome, requires a large number of repeated tests manually, takes a long time and is inefficient.
[0064] In order to make the purpose, features and advantages of the present invention more obvious and easy to understand, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described below are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0065] See also Figure 1 , Figure 1 A flowchart of the steps of a device firmware packaging test method provided by an embodiment of the present invention.
[0066] The present invention provides a device firmware packaging test method, which may specifically include the following steps:
[0067] Step 101, the git service responds to the firmware code submitted by the firmware developer, triggers a webhook notification, and sends the webhook notification to the development platform;
[0068] The git service is a code management platform used to submit firmware code and set up webhook notifications in the code repository.
[0069] When the git service receives the code submitted by the firmware developer, it can trigger the webhook notification and call the development platform interface to issue packaging instructions.
[0070] Step 102, the development platform obtains the packaging configuration according to the webhook notification, generates packaging instructions according to the packaging configuration, and sends the packaging instructions to the compilation service;
[0071] The development platform is a web application used to manage firmware packaging tasks and monitor the packaging process.
[0072] The compilation service is a Linux system that has built the environment required for firmware code compilation and packaging. It is used to perform packaging and compilation, update device tasks, and send test tasks to the test service.
[0073] In a specific implementation, the development platform can extract the packaging configuration from the received webhook notification to generate packaging instructions according to the packaging configuration, and send the packaging instructions to the compilation service for packaging and compilation operations.
[0074] In the embodiment of the present invention, the packaging configuration may be added in advance in the development platform, and the configuration content may include:
[0075] Identification: content customization, used to distinguish the packaging processes of different devices;
[0076] Specify device type: drop-down selection, fixed options, add an option for each additional device test, this parameter is required to set related parameters when packaging the firmware;
[0077] Package type: drop-down selection, fixed content, including upgrade package and firmware package options;
[0078] Source code project name: associated with the git service, that is, the code repository name;
[0079] Source code acquisition method: drop-down selection, fixed content, including not acquiring, cloning, and pulling;
[0080] Compilation environment address: http address, used to associate the development platform and compilation service and issue packaging instructions;
[0081] Device IP / port, login username / password: connection information of the device to be tested, used when updating the device firmware;
[0082] FTP address: the address where the firmware package is stored, used when updating the device firmware;
[0083] Test service address: used to issue test tasks;
[0084] Device model: used when performing the test;
[0085] Quality inspection board IP: used when performing tests.
[0086] Step 103, the compiling service packages the firmware code according to the packaging instruction to obtain a firmware package;
[0087] In the embodiment of the present invention, after receiving the packaging instruction, the compiling service may package the firmware code to obtain a firmware package.
[0088] Step 104: After packaging is completed, the compiling service logs in to the preset device background, and controls the device under test to obtain the firmware package and restart the device through the preset device background;
[0089] In the embodiment of the present invention, after packaging is completed, the compiling service can log in to the device backend through ssh, operate the device under test to automatically obtain the firmware package, decompress and restart the device under test.
[0090] Step 105, when the compilation service detects that the device under test has completed the device restart, it sends the test task to the test service;
[0091] The compilation service can monitor the device restart status in real time. When it detects that the device restart is complete, it can send the test task to the test service.
[0092] Step 106: The test service tests the device to be tested through the test task to obtain the test result.
[0093] The test service can execute the script of the test task to test the device under test, obtain the test results, and send the test results to relevant personnel after the test is completed.
[0094] The present invention saves manual packaging steps by converting the device firmware testing process from manual to fully automatic, replaces part of the repetitive regression testing work of the hardware device, shortens the testing cycle and improves the testing efficiency.
[0095] See also Figure 2 , Figure 2 A flowchart of a device firmware packaging test method provided by another embodiment of the present invention. Specifically, the following steps may be included:
[0096] Step 201, the git service responds to the firmware code submitted by the firmware developer, triggers a webhook notification, and sends the webhook notification to the development platform;
[0097] Step 202, the development platform obtains the packaging configuration according to the webhook notification, generates packaging instructions according to the packaging configuration, and sends the packaging instructions to the compilation service;
[0098] Steps 201-202 are the same as steps 101-102. For details, please refer to the description of steps 101-102, which will not be repeated here.
[0099] Step 203, obtaining the source code acquisition method, specifying the device type and the packaging type from the packaging configuration;
[0100] In the embodiment of the present invention, the source code acquisition method, the specified device type and the packaging type can be obtained from the packaging configuration.
[0101] Step 204, obtain the firmware code according to the source code acquisition method, generate an HTTP request and a process log, and send the HTTP request and the process log to the development platform. The HTTP request carries the current packaging progress, and the process log is cached in a preset database;
[0102] In the embodiment of the present invention, the latest firmware code can be obtained according to the source code acquisition method obtained from the packaging configuration, and at the same time, an http request is sent to notify the development platform of the current packaging progress, and the process log is cached in the database.
[0103] Among them, the source code acquisition methods may include not acquiring, cloning, and pulling.
[0104] Clone: Delete the original code and execute the git clone command.
[0105] Pull: Execute the git pull command.
[0106] Do not obtain: Do not perform the update code operation.
[0107] Step 205, modifying the device type parameter in the configuration file of the firmware code according to the specified device type;
[0108] In an embodiment of the present invention, the Linux command sed -i may be executed according to the specified device type in the packaging configuration to modify the device type parameter in the code configuration file.
[0109] Step 206, clearing the original compilation cache in the code directory of the modified firmware code, and executing the compilation command to obtain the firmware code compilation result;
[0110] In an embodiment of the present invention, in an embodiment of the present invention, you can enter the firmware code directory of the firmware code, execute the clear cache command to clear the original compilation cache, and then execute the compilation command, and at the same time send an http request to notify the development platform of the current packaging progress, and cache the process log to the database.
[0111] Step 207, packaging the firmware code compilation result to generate a firmware package;
[0112] Step 208: After packaging is completed, the compiling service logs in to the preset device background, and controls the device under test to obtain the firmware package and restart the device through the preset device background;
[0113] In one example, step 208 may include the following sub-steps:
[0114] S81, after packaging is completed, the compilation service logs in to the preset device background and obtains the device IP / port, login username / password from the packaging configuration;
[0115] S82, log in to the device under test according to the device IP / port, login username / password;
[0116] S83, after logging into the device under test, sending a firmware package to the device under test to update the device;
[0117] S84, after the device is updated successfully, control the device under test to restart the device.
[0118] In the specific implementation, you can execute the linux command ssh to remotely connect to the device according to the device IP / port, login username / password in the packaging configuration, and execute the send and expect commands to simulate manual sending of commands to the remote device and receiving output results; the command operations include: logging in to the device, obtaining administrator privileges, entering the firmware program directory, executing the tftp command to pull the firmware package, and restarting the device. At the same time, use the linux command ping to connect to the device. If the device connection status changes from connected to unconnected and then to connected within the specified timeout period, it means that the device update is successful. At the same time, send an http request to notify the development platform of the current packaging progress, and cache the process log to the database.
[0119] Step 209, when the compilation service detects that the device under test has completed the device restart, it sends the test task to the test service;
[0120] In the embodiment of the present invention, step 209 may include the following sub-steps:
[0121] S91, when the compilation service detects that the device under test has completed the device restart, the device IP, device type, quality inspection board IP, and firmware version number are obtained from the package configuration;
[0122] S92, using device IP, device type, quality inspection board IP and firmware version number to generate a task generation request;
[0123] S93: Send the task generation request to the test service to generate a test task.
[0124] In the specific implementation, the device IP, device type, quality inspection board IP in the packaging configuration, and the firmware version number obtained after successful packaging can be sent to the test service through a task generation request (http request). The test service adds the device to the test task queue and replies, then the test task is completed. At the same time, an http request is sent to notify the development platform of the current packaging progress and cache the process log to the database.
[0125] Step 210: The test service tests the device to be tested through the test task to obtain the test result.
[0126] In this embodiment of the present invention, step 210 may include the following sub-steps:
[0127] S101, establish a connection with the quality inspection board according to the quality inspection board IP;
[0128] S102, obtaining the protocol type supported by the device under test according to the device IP;
[0129] S103, starting the corresponding device service according to the protocol type;
[0130] S104, obtaining the test device type and test firmware version number of the device under test;
[0131] S105, comparing the test device type with the device type, and the test firmware version number with the firmware version number to see if they are the same;
[0132] S106, if they are the same, load the test case, and after the device under test is restarted, establish a connection between the device service and the device under test;
[0133] S107, sending a test instruction to the device under test and the quality inspection board through the device service according to the test case, the test instruction is used for data interaction between the quality inspection board and the device under test;
[0134] S108, receiving result information returned by the quality inspection board and the device under test in response to the test instruction;
[0135] S109, comparing the result information with the expected result to obtain the test result.
[0136] In the specific implementation, the automatic testing process is as follows Figure 3 As shown in the figure, after the test service receives the test task sent by the compilation service, it saves the test task information into the database. The test service starts another working process to cyclically obtain the task information in the database and execute the test script. Taking the InBioP3000 controller test as an example, the specific test process is as follows:
[0137] 1. Connect to the quality inspection board: According to the quality inspection board IP in the test task, the script program establishes a connection with the quality inspection board. The quality inspection board is used to receive script instructions and simulate manual operation of the controller device, such as short-circuiting the door opening button, sending Wiegand verification data, etc.
[0138] 2. Start device service: According to the device IP in the test task, obtain the protocol type supported by the device and start the corresponding service to establish a connection with the device under test;
[0139] 3. Test data verification: Check whether the test device type and test firmware version number of the device under test in the script are consistent with the device type and firmware version number in the test task. If they are inconsistent, the test will be terminated and the relevant personnel will be notified by email;
[0140] 4. Load test cases: The script loads the previously maintained P3000 device test cases;
[0141] 5. Connecting to the device: Sending device parameter setting instructions, waiting for the device to restart, and then simulating the software to establish a connection with the device under test through the started device service;
[0142] 6. Execute the test: According to the test case, send relevant instructions to the device under test and the quality inspection board, receive the information replied by the device under test and the quality inspection board, compare and judge with the expected results, and get the test results.
[0143] 7. Test result notification: The test results will be sent to relevant personnel via email.
[0144] Furthermore, the present invention can also monitor the packaging process, and the specific process is as follows:
[0145] The user enters Development Platform > Packaging Management > Firmware Packaging and clicks to view the progress. At this time, the development platform will establish a websocket connection with the compilation service and send instructions to obtain the packaging log at a certain frequency. The compilation service will filter out the corresponding packaging log from the database according to the packaging identifier and push it to the development platform. The development platform will display the content in real time.
[0146] The present invention saves manual packaging steps by converting the device firmware testing process from manual to fully automatic, replaces part of the repetitive regression testing work of the hardware device, shortens the testing cycle and improves the testing efficiency.
[0147] See also Figure 4 , Figure 4 A structural block diagram of a device firmware packaging test device provided by an embodiment of the present invention.
[0148] An embodiment of the present invention provides a device firmware packaging test device, including:
[0149] git service 401, which is used to respond to the firmware code submitted by the firmware developer, trigger the webhook notification, and send the webhook notification to the development platform;
[0150] The development platform 402 is used to obtain the packaging configuration according to the webhook notification, generate the packaging instructions according to the packaging configuration, and send the packaging instructions to the compilation service;
[0151] Compilation service 403 is used to package the firmware code according to the packaging instruction to obtain the firmware package; it is also used to log in to the preset device background after the packaging is completed, and control the device under test to obtain the firmware package and restart the device through the preset device background; it is also used to send the test task to the test service when it is detected that the device under test has completed the device restart;
[0152] The test service 404 is used to test the device to be tested through the test task and obtain the test result.
[0153] In the embodiment of the present invention, the compilation service 403 includes:
[0154] The source code acquisition method, specified device type and packaging type acquisition module is used to obtain the source code acquisition method, specified device type and packaging type from the packaging configuration;
[0155] The firmware code acquisition module is used to obtain the firmware code according to the source code acquisition method, generate an http request and a process log, and send the http request and the process log to the development platform. The http request carries the current packaging progress, and the process log is cached in a preset database.
[0156] A device type parameter modification module, used to modify the device type parameters in the configuration file of the firmware code according to the specified device type;
[0157] A compiling module is used to clear the original compiling cache in the code directory of the modified firmware code and execute the compiling command to obtain the firmware code compiling result;
[0158] The firmware package generation module is used to package the firmware code compilation results and generate a firmware package.
[0159] In the embodiment of the present invention, the compilation service 403 further includes:
[0160] The device IP / port, login username / password acquisition module is used for the compilation service to log in to the preset device backend after packaging is completed, and obtain the device IP / port, login username / password from the packaging configuration;
[0161] Login module, used to log in to the device under test according to the device IP / port, login username / password;
[0162] The device update module is used to send a firmware package to the device under test to update the device after logging in to the device under test;
[0163] The device restart module is used to control the device under test to restart after the device is successfully updated.
[0164] In the embodiment of the present invention, the compilation service 403 further includes:
[0165] The module for obtaining device IP, device type, quality inspection board IP, and firmware version number is used to obtain the device IP, device type, quality inspection board IP, and firmware version number from the package configuration when the compilation service detects that the device under test has completed the device restart;
[0166] The task generation request generation module is used to generate a task generation request using the device IP, device type, quality inspection board IP and firmware version number;
[0167] The test task sending module is used to send the task generation request to the test service to generate a test task.
[0168] In an embodiment of the present invention, the testing service includes:
[0169] The quality inspection board connection module is used to establish a connection with the quality inspection board according to the quality inspection board IP;
[0170] The protocol type acquisition module is used to obtain the protocol type supported by the device under test according to the device IP;
[0171] The device service startup module is used to start the corresponding device service according to the protocol type;
[0172] A test device type and test firmware version number acquisition module is used to obtain the test device type and test firmware version number of the device under test;
[0173] A comparison module is used to compare the test device type with the device type, and to test whether the firmware version number is the same as the firmware version number;
[0174] The device under test connection module is used to load the test case if they are the same, and establish a connection between the device service and the device under test after the device under test is restarted;
[0175] The test instruction sending module is used to send test instructions to the device under test and the quality inspection board through the device service according to the test case. The test instructions are used for data interaction between the quality inspection board and the device under test;
[0176] A result information receiving module is used to receive result information returned by the quality inspection board and the device under test in response to the test instruction;
[0177] The test result generation module is used to compare the result information with the expected result to obtain the test result.
[0178] An embodiment of the present invention further provides an electronic device, the device comprising a processor and a memory:
[0179] The memory is used to store the program code and transmit the program code to the processor;
[0180] The processor is used to execute the device firmware packaging test method of the embodiment of the present invention according to the instructions in the program code.
[0181] An embodiment of the present invention further provides a computer-readable storage medium, characterized in that the computer-readable storage medium is used to store program code, and the program code is used to execute the device firmware packaging test method of the embodiment of the present invention.
[0182] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0183] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0184] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0185] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0186] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0187] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0188] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0189] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0190] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A device firmware packaging test method, characterized in that: include: The git service responds to the firmware code submitted by the firmware developer, triggers a webhook notification, and sends the webhook notification to the development platform; The development platform obtains a packaging configuration according to the webhook notification, generates a packaging instruction according to the packaging configuration, and sends the packaging instruction to the compilation service; The compiling service packages the firmware code according to the packaging instruction to obtain a firmware package; After packaging is completed, the compiling service logs in to the preset device background, and controls the device under test to obtain the firmware package and restart the device through the preset device background; When the compilation service detects that the device under test has completed the device restart, it sends the test task to the test service; The test service tests the device under test through the test task to obtain a test result.
2. The method according to claim 1, characterized in that The step of the compilation service packaging the firmware code according to the packaging instruction to obtain a firmware package includes: Obtain source code acquisition method, specified device type and packaging type from the packaging configuration; Acquire the firmware code according to the source code acquisition method, generate an http request and a process log, and send the http request and the process log to the development platform, wherein the http request carries the current packaging progress, and the process log is cached in a preset database; Modify the device type parameter in the configuration file of the firmware code according to the specified device type; Clear the original compilation cache in the code directory of the modified firmware code, and execute the compilation command to obtain the firmware code compilation result; The firmware code compilation result is packaged to generate a firmware package.
3. The method according to claim 1, characterized in that: The step of the compilation service logging into the preset device background after packaging is completed, and controlling the device under test to obtain the firmware package and restart the device through the preset device background, includes: The compilation service logs into the preset device backend after packaging is completed, and obtains the device IP / port, login username / password from the packaging configuration; Log in to the device under test according to the device IP / port and the login username / password; After logging into the device under test, controlling the device under test to pull the firmware package to perform device update; After the device is updated successfully, the device under test is controlled to restart.
4. The method according to claim 2, characterized in that: The step of sending a test task to a test service when the compilation service detects that the device under test has completed a device restart comprises: When the compilation service detects that the device under test has completed the device restart, the device IP, device type, quality inspection board IP, and firmware version number are obtained from the package configuration; Generate a task generation request using the device IP, the device type, the quality inspection board IP and the firmware version number; The task generation request is sent to the test service to generate a test task.
5. The method according to claim 4, characterized in that The step of the test service testing the device under test through the test task to obtain the test result includes: Establish a connection with the quality inspection board according to the quality inspection board IP; Obtaining the protocol type supported by the device under test according to the device IP; Start the corresponding device service according to the protocol type; Obtain the test device type and test firmware version number of the device under test; Comparing the test device type with the device type, and the test firmware version number with the firmware version number to see if they are the same; If they are the same, load the test case, and after the device under test is restarted, establish a connection between the device service and the device under test; According to the test case, a test instruction is sent to the device under test and the quality inspection board through the device service, wherein the test instruction is used for data interaction between the quality inspection board and the device under test; Receiving result information returned by the quality inspection board and the device under test in response to the test instruction; The result information is compared with the expected result to obtain the test result.
6. A device firmware packaging test device, characterized in that: include: The git service is used to respond to the firmware code submitted by the firmware developer, trigger the webhook notification, and send the webhook notification to the development platform; A development platform, configured to obtain a packaging configuration according to the webhook notification, generate a packaging instruction according to the packaging configuration, and send the packaging instruction to a compilation service; A compiling service, used for packaging the firmware code according to the packaging instruction to obtain a firmware package; It is also used to log in to the preset device background after packaging is completed, and control the device under test to obtain the firmware package through the preset device background to restart the device; It is also used to send a test task to the test service when it is detected that the device under test has completed the device restart; The test service is used to test the device under test through the test task and obtain the test result.
7. The device according to claim 6, characterized in that The compilation service includes: A source code acquisition method, a specified device type, and a packaging type acquisition module, used to acquire a source code acquisition method, a specified device type, and a packaging type from the packaging configuration; A firmware code acquisition module, used to acquire the firmware code according to the source code acquisition method, and generate an http request and a process log, and send the http request and the process log to the development platform, wherein the http request carries the current packaging progress, and the process log is cached in a preset database; A device type parameter modification module, used to modify the device type parameter in the configuration file of the firmware code according to the specified device type; A compiling module, used to clear the original compiling cache in the code directory of the modified firmware code, and execute the compiling command to obtain the firmware code compiling result; The firmware package generation module is used to package the firmware code compilation result to generate a firmware package.
8. The device according to claim 6, characterized in that The compilation service also includes: The device IP / port, login username / password acquisition module is used for the compilation service to log in to the preset device background after packaging is completed, and obtain the device IP / port, login username / password from the packaging configuration; A login module, used to log in to the device under test according to the device IP / port and the login username / password; A device update module, used for controlling the device under test to pull the firmware package to perform device update after logging into the device under test; The device restart module is used to control the device under test to restart the device after the device is successfully updated.
9. An electronic device, characterized in that: The device comprises a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the device firmware packaging test method described in any one of claims 1-5 according to the instructions in the program code.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store program code, and the program code is used to execute the device firmware packaging test method according to any one of claims 1-5.
Citation Information
Patent Citations
Package method and device
CN107391155A
BIOS continuous integration platform and method
CN108536558A
Front-end deployment method and device, equipment and storage medium
CN116756034A
UFS firmware testing method, device and equipment and readable storage medium
CN118503119A
Radioactive waste treatment system and method thereof
KR1020230009768A
