CN-121979779-A - Operating system image testing method and device, electronic equipment and product
Abstract
The embodiment of the application is applicable to the field of computers and provides an operating system image testing method, an operating system image testing device, electronic equipment and a product, wherein the operating system image testing method is applied to the electronic equipment, the electronic equipment comprises a first virtual machine and a second virtual machine connected with the first virtual machine through a virtual network, and the method comprises the steps of controlling the first virtual machine to execute an image generation script to generate a target image package of a target operating system and transmitting the target image package to the second virtual machine through the virtual network; and controlling the second virtual machine to install the target mirror image package and test, and generating a test report of the target operating system. By adopting the method, the test efficiency of the target operating system can be improved.
Inventors
- CHEN LIN
- LI ZHAO
- HAN MAOLIN
- CHEN YAO
- HU HAI
- Zhou Renhang
- SUN LEI
- JIN TAO
- WU TAO
Assignees
- 长园深瑞继保自动化有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20251223
Claims (10)
- 1. An operating system image testing method, which is characterized by being applied to an electronic device, wherein the electronic device comprises a first virtual machine and a second virtual machine connected with the first virtual machine through a virtual network, and the method comprises the following steps: controlling the first virtual machine to execute a mirror image generation script to generate a target mirror image packet of a target operating system, and transmitting the target mirror image packet to the second virtual machine through the virtual network; And controlling the second virtual machine to install the target mirror image package and test the target mirror image package, and generating a test report of the target operating system.
- 2. The method of claim 1, wherein controlling the first virtual machine to execute a mirror generation script generates a target mirror package, comprising: The method comprises the steps of obtaining a configuration file of a target mirror image package and an installation package corresponding to a target operating system, wherein the configuration file comprises a configuration rule file and a dependency relationship configuration file, the configuration rule file is used for describing configuration rules in the installation process of the target mirror image package, and the dependency relationship configuration file is used for recording dependency relationships among a plurality of software packages in the target mirror image package; And controlling the first virtual machine to execute the mirror image generation script, and integrating the configuration file and the installation package to generate the target mirror image package.
- 3. The method of claim 2, wherein the obtaining the configuration file of the target image package and the installation package corresponding to the target operating system includes: Controlling a configuration file generator to display a graphical configuration interface, and responding to configuration operation of a user on the graphical configuration interface to generate the configuration rule file; The control dependency relationship generator analyzes the dependency relationship of a plurality of software packages to be integrated into the target image package, and generates the dependency relationship configuration file; And controlling an installation package generator to package the functional components realizing the customized function of the target operating system into the installation package in a preset format based on a preset standardized template.
- 4. The method of claim 1, wherein the controlling the second virtual machine to install the target image package and perform testing generates a test report of the target operating system, comprising: the second virtual machine is controlled to download the target mirror image package, and the second virtual machine is stored to a preset first virtual hard disk; After the transmission of the target mirror image packet is completed, controlling the first virtual machine to send a restarting instruction to the second virtual machine; The second virtual machine is controlled to be restarted in response to the restarting instruction by a guiding system which is arranged on a preset second virtual hard disk in the second virtual machine, the second virtual machine is guided to read the target mirror image package from the first virtual hard disk, and the target mirror image package is installed on a preset third virtual hard disk; and after the installation of the target mirror image package is completed, controlling the second virtual machine to start the target operating system in the third virtual hard disk, testing the target operating system, and generating a test report of the target operating system.
- 5. The method of claim 4, further comprising, after said controlling said second virtual machine to install said target image package and test, generating a test report for said target operating system: generating a test result for the target operating system based on the test report; and if the test result is that the test fails, controlling the second virtual machine to delete the file corresponding to the installed target operating system in the third virtual hard disk, and repeatedly executing the steps of generating the target mirror image package and testing.
- 6. The method according to claim 5, further comprising: and in the step of repeatedly executing the generation and testing of the target image package, reserving the target image package which is downloaded and stored in the first virtual hard disk for the past time.
- 7. The method of any of claims 1-6, wherein the system performance of the first virtual machine allocation is better than the system performance of the second virtual machine allocation.
- 8. An operating system image testing apparatus, applied to an electronic device, the electronic device including a first virtual machine and a second virtual machine connected to the first virtual machine through a virtual network, the apparatus comprising: the first control module is used for controlling the first virtual machine to execute a mirror image generation script to generate a target mirror image packet of a target operating system, and transmitting the target mirror image packet to the second virtual machine through the virtual network; And the second control module is used for controlling the second virtual machine to install the target mirror image package and test the target mirror image package, and generating a test report of the target operating system.
- 9. An electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the method of any one of claims 1 to 7 when the computer program is executed.
- 10. A computer program product, characterized in that the computer program product, when run on an electronic device, causes the electronic device to perform the method of any one of claims 1 to 7.
Description
Operating system image testing method and device, electronic equipment and product Technical Field The present application relates to the field of computer technologies, and in particular, to a method and apparatus for testing an operating system image, an electronic device, and a product. Background Along with the rapid development of information technology, the customization demands of scenes such as server deployment, embedded equipment, special terminals and the like on an operating system are increasing, the operating system mirror image is used as a core carrier of a customization result, and the functional integrity and the running stability of the operating system mirror image directly influence the project delivery quality. Therefore, efficient and accurate testing of images is a central need in the industry. At present, in the prior art, a technician needs to manually compile and generate a mirror image package of a customized operating system on a special mirror image making physical machine, then manually write the mirror image package into a physical U disk, carry the U disk to a specified test physical machine and access the physical U disk. After the physical machine to be tested reads the mirror image package from the U disk to complete system installation, technicians need to manually operate test cases, check system functions and record results to generate a test report. However, the method relies on manual intervention in the whole process, and the mirror image package is copied through physical media such as a USB flash disk and cross-device scheduling is completed, so that the hardware cost and the copying cost of the physical media are additionally increased, the time consumption is complicated in the test flow caused by the mirror image transmission through the physical media, and the test efficiency is low. Disclosure of Invention The embodiment of the application provides an operating system mirror image testing method, an operating system mirror image testing device, electronic equipment and a product, which can solve the problem of low testing efficiency of an operating system. In a first aspect, an embodiment of the present application provides a method for testing an operating system image, which is applied to an electronic device, where the electronic device includes a first virtual machine, and a second virtual machine connected to the first virtual machine through a virtual network, and the method includes: controlling a first virtual machine to execute a mirror image generation script to generate a target mirror image packet of a target operating system, and transmitting the target mirror image packet to a second virtual machine through a virtual network; and controlling the second virtual machine to install the target mirror image package and test, and generating a test report of the target operating system. According to the technical scheme, the electronic equipment is divided into the first virtual machine and the second virtual machine, the first virtual machine is controlled to independently execute the mirror image generation script to generate the target mirror image package of the target operating system, and the target mirror image package is directly transmitted to the second virtual machine by means of the virtual network, so that links of physical medium preparation, manual copying and equipment scheduling are omitted compared with the mode that related technologies rely on physical medium copying such as a USB flash disk and manual cross-physical equipment scheduling, physical resource input cost is reduced, transmission efficiency of the target mirror image package is improved, and overall testing efficiency of the target testing system is improved. Meanwhile, the first virtual machine is focused on the mirror image generation task, so that the occupation of computing resources in the test is avoided. Finally, the second virtual machine is controlled to automatically complete the installation and test of the target image package and generate a test report, so that the complete isolation between the image generation environment and the test environment is realized, the problem of interference test stability caused by the occupation of the resources of the generated target image package due to single-environment coupling in the related technology is effectively avoided, the accuracy and the reliability of a test result are ensured, and the test efficiency of a target operating system is improved. In one embodiment, controlling the first virtual machine to execute the image generation script to generate the target image package includes: The method comprises the steps of obtaining a configuration file of a target mirror image package and an installation package corresponding to a target operating system, wherein the configuration file comprises a configuration rule file and a dependency relationship configuration file, the configuration rule file is used for descr