Method for adding equipment under LAVA
By filling in device information in the front-end interface in the LAVA system and automatically generating template files, the problem of cumbersome equipment addition and high error rate is solved, the convenience of equipment addition and system robustness is achieved, and the accuracy and security of equipment addition are improved. .
Patent Information
- Application Number
- CN202411357683.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2024-12-31
AI Technical Summary
The process of adding new devices in the LAVA system is cumbersome and error-prone, resulting in task failure and delayed version release, and incomplete display of device information on the front-end management interface, which may lead to damage to the master server environment.
By filling in device information in the front-end interface, defining public information, performing verification and storage, and automatically generating device template files, avoiding manual operations in the background, and automatically triggering device inspection tasks, simplifying the device addition process and improving system robustness.
It simplifies the process of adding and updating equipment, reduces the manual error rate, improves the robustness of the system and the security of the master server, and improves the convenience and accuracy of adding equipment.
Smart Images

Figure CN119225830A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of LAVA technology, and specifically provides a method for adding equipment under LAVA. Background Art
[0002] LAVA is a continuous integration system maintained by Linaro. It runs on Linux hosts or servers and is used to deploy operating systems to physical or virtual hardware devices for testing. Physical devices include those running Android, Linux, or other embedded operating systems. It can be used for pre-release testing, version verification, and daily testing.
[0003] LAVA uses a master-slave architecture. The master server is responsible for dispatching tasks, managing test equipment, and collecting test results. Upon receiving tasks, the master server schedules them based on task type, device type, and availability, dispatching them to slave servers. The slave servers are responsible for dispatching the tasks dispatched by the master to specific test equipment, providing the required testing environment, and executing the tests. Tasks can be triggered in a variety of ways. These can be triggered automatically by calling the LAVA interface after a Jenkins build, or manually through the front-end interface, allowing for simultaneous testing of multiple devices across multiple types of tests.
[0004] The foundation for these tests is the hardware devices mounted on each slave server. When LAVA adds a new test device, it needs to perform related operations on the master server. Therefore, as the number of devices to be tested increases, the convenience of adding devices is also required.
[0005] When adding a device, LAVA needs to add the device under the corresponding device type in the front-end management interface, fill in the device type, device name, corresponding slave server and other information. After filling in, it is also necessary to add the corresponding device configuration file on the master server, configure the device serial number, slave server address, PDU address and other information, and then the master server can send the test task to the device through the slave server. Not only are the steps cumbersome, but it is also easy to cause task failure and delay version release due to manual information filling errors. In addition, there is also the disadvantage of incomplete display of device information on the front-end management interface. Direct operation on the server may also cause damage to the master server environment. Summary of the Invention
[0006] In order to overcome the above-mentioned defects, the present invention is proposed to solve the technical problems of the prior art in that the process of adding new equipment to LAVA is cumbersome and has a high failure rate.
[0007] The present invention provides a method for adding a device under LAVA. After filling in the information of the device to be added at the front end, the following steps are performed in sequence: Define public information and extract public information of the device to be added input by the front end; Generate a dictionary based on the public information of the device to be added, verify the public information, intercept the public information that does not meet the preset rules and refuse to add the corresponding device; Establish a database device table and store the verified public information in the database device table; Obtain the corresponding template file according to the type of device to be added, and copy it to the same directory as the template file, rename the newly obtained template file as the configuration file for the device to be added, and then update the device information to the configuration file; Call the task start interface to start the device check task to check whether the device to be added is normal. After the task is completed and there is no abnormal information, the device addition is completed.
[0008] Furthermore, on the front-end interface, the public information includes the device serial number, slave name and PDU address port.
[0009] Furthermore, on the front-end interface, an input field is provided for the defined public information, and a remark information field is used to store the public information, binding the public information to the remark information.
[0010] Furthermore, the database device table can perform insert, update or delete operations according to needs.
[0011] Working principle and beneficial effects of the present invention: In implementing the technical solution of this invention, the LAVA process has been redesigned and the method for adding device information has been reorganized, allowing administrators to add devices directly through the front-end, eliminating the need to manually access the server to make changes. Furthermore, the program automatically generates device template files through parameter transfer from the front-end, replacing the traditional manual access to the server to add devices. This reduces errors and frees up manpower. The program also automatically triggers a device check task after the device is added. This simplifies the process of adding and updating devices, improving the robustness of the system and the security of the master server. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] The disclosure of the present invention will be more easily understood with reference to the accompanying drawings. Those skilled in the art will readily appreciate that these drawings are for illustrative purposes only and are not intended to limit the scope of protection of the present invention. Furthermore, similar numbers in the drawings represent similar components, wherein: Figure 1 The present invention is a flow chart of the main steps of a method for adding equipment under LAVA. DETAILED DESCRIPTION
[0013] Some embodiments of the present invention are described below with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are only used to explain the technical principles of the present invention and are not intended to limit the scope of protection of the present invention.
[0014] Figure 1 This is a flow chart of the main steps of a method for adding equipment under LAVA of the present invention. Figure 1 As shown in the figure, fill in the information of the device to be added (device type, device name, corresponding slave, etc.) in the front-end management interface, and then perform the following steps in sequence.
[0015] 1. Unified information processing Define public information including device serial number, slave name and PDU address port, and extract public information of the device to be added input by the front end.
[0016] In one embodiment, an input field is provided on the front-end interface for the defined public information, and a note field may be used to store this non-critical but useful public information. The note field of the device is used to bind the public information to the note information without disrupting the original interface layout.
[0017] 2. Device information verification After the front-end obtains the initial data through step 1, it generates a dictionary and verifies the public information. It intercepts public information that does not conform to the preset rules and refuses to add the corresponding device. This ensures that the entered public information conforms to the preset rules to prevent invalid or erroneous data from being added to the system.
[0018] When verifying public information, first ensure that the device type is within the supported range, then check the device serial number. For example, the serial number of an Android device must contain a 19-digit code starting with "SN", and if the serial number already exists, it cannot be added. The PDU address must meet the IP address specifications, be checked for regularity after input, and ensure that the PDU address is within the available range.
[0019] 3. Store in database Create a database device table for subsequent querying, updating, and deletion. The backend stores verified public device information in the database device table. Perform database device table operations such as inserting, updating, and deleting records as needed.
[0020] For example, when a super administrator views device information, he reads it from this table; when updating device information, he updates the corresponding device information in the table; when deleting device information, he deletes the device record from the table.
[0021] 4. Generate configuration files The device configuration file is stored in the device directory of the master server. The file stores device information, task information, etc. It is used to read the device information and task information after receiving the task for subsequent scheduling. When the device information is successfully stored in the database device table, the back-end processing program receives the signal that the device information storage is completed, and searches for the corresponding template file in the directory according to the type of device to be added. It then generates a copy of the found template file and renames it with the device name + task type of the added device.
[0022] 5. Launch LAVA mission After adding the device configuration file, call the task interface to start the device health check task, perform basic power on / off checks, ADB checks, etc. on the device. After the task is completed, the result will be used to determine whether the newly added device is normal. If the device status is abnormal, the reason will be notified by email, and the device will not be used for task scheduling on the master. If the status is normal, the device addition is completed and an email notification will be sent. This device can be used for subsequent scheduling and delivery tasks.
[0023] Based on steps 1-5 above, LAVA is used to manage the note fields when adding devices. Manual modifications in the backend are abstracted from public information. Without changing the LAVA interface layout, the LAVA process is redesigned and the method for adding device information is reorganized through programming, allowing administrators to add devices directly through the frontend, avoiding the need to access the server to make changes. The program is also designed to automatically generate device template files in the backend through parameter transfer from the frontend, replacing the original manual access to the server backend to add devices, reducing errors and freeing up manpower. The program also automatically triggers a device check task after the device is added. This simplifies the process of adding and updating devices, improving the robustness of the system and the security of the master server.
[0024] It should be pointed out that although the various steps in the above embodiments are described in a specific order, those skilled in the art will understand that in order to achieve the effects of the present invention, different steps do not have to be performed in such an order. They can be performed simultaneously (in parallel) or in other orders. These changes are within the scope of protection of the present invention.
[0025] Thus far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art may make equivalent changes or substitutions to the relevant technical features, and the technical solutions after such changes or substitutions will fall within the scope of protection of the present invention.
Claims
1. A method for adding equipment under LAVA, characterized in that: After filling in the information of the device to be added on the front end, perform the following steps in sequence: Define public information and extract public information of the device to be added input by the front end; Generate a dictionary based on the public information of the device to be added, verify the public information, intercept the public information that does not meet the preset rules and refuse to add the corresponding device; Establish a database equipment table and store the verified public information in the database equipment table; Obtain the corresponding template file according to the type of the device to be added, and copy it to the same directory as the template file, rename the newly obtained template file as the configuration file of the device to be added, and then update the device information to the configuration file; Call the task start interface to start the device check task to check whether the device to be added is normal. After the task is completed and there is no abnormal information, the device addition is completed.
2. A method for adding equipment under LAVA according to claim 1, characterized in that: On the front-end interface, the public information includes the device serial number, slave name and PDU address port.
3. A method for adding equipment under LAVA according to claim 1, characterized in that: On the front-end interface, input fields are provided for the defined public information, and the remark information fields are used to store the public information, binding the public information to the remark information.
4. A method for adding equipment under LAVA according to claim 1, characterized in that: The database device table can perform insert, update or delete operations according to requirements.