CN114676069A - Kernel file testing method, device, equipment and storage medium - Google Patents

Kernel file testing method, device, equipment and storage medium Download PDF

Info

Publication number
CN114676069A
CN114676069A CN202210595956.5A CN202210595956A CN114676069A CN 114676069 A CN114676069 A CN 114676069A CN 202210595956 A CN202210595956 A CN 202210595956A CN 114676069 A CN114676069 A CN 114676069A
Authority
CN
China
Prior art keywords
kernel
file
target
tested
test
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210595956.5A
Other languages
Chinese (zh)
Other versions
CN114676069B (en
Inventor
张建
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Clerware Technology Co ltd
Original Assignee
Shenzhen Clerware Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Clerware Technology Co ltd filed Critical Shenzhen Clerware Technology Co ltd
Priority to CN202210595956.5A priority Critical patent/CN114676069B/en
Publication of CN114676069A publication Critical patent/CN114676069A/en
Application granted granted Critical
Publication of CN114676069B publication Critical patent/CN114676069B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44594Unloading

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Quality & Reliability (AREA)
  • Computer Hardware Design (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention relates to the technical field of kernel testing, and discloses a kernel file testing method, a kernel file testing device, kernel file testing equipment and a storage medium, wherein the method comprises the following steps of: acquiring a kernel file to be tested and a kernel dependency header file; when the kernel file to be tested is a newly added kernel file, automatically compiling a corresponding drive file according to the kernel dependency header file; constructing a target timing backup plan according to the drive file and the target automation test script; testing the kernel file to be tested through a target timing backup plan and a target automatic installation and uninstallation script according to the kernel guide sequence; according to the invention, the target timed backup plan is constructed through the drive files and the target automatic test scripts, and the kernel files to be tested are tested through the target timed backup plan and the target automatic installation and uninstallation scripts according to the kernel guide sequence, so that when a plurality of kernel files to be tested exist and a certain kernel file fails to be tested, other kernel files can be tested continuously, and the efficiency of testing the kernel files is further effectively improved.

Description

Kernel file testing method, device, equipment and storage medium
Technical Field
The present invention relates to the field of kernel testing technologies, and in particular, to a kernel file testing method, apparatus, device, and storage medium.
Background
An agent program is required to be installed at a source end under a C/S architecture with an agent disaster recovery scene, the agent program comprises a key drive module, the drive module has a version dependence problem, the drive module is closely associated with a data structure and a function prototype defined by a specific kernel version, an interface defined in a kernel can be greatly changed along with the change of the version, so that the agent program cannot normally work, even a source machine is down in severe cases, the current common solution is that a tester regularly pulls a new kernel and a related compiling dependence file to an official website, then a driver developer manually compiles a drive and submits the drive to the tester after the drive is successfully compiled, the tester installs the new kernels in batch (or single) mode, then tests the basic functions of a product, specifically including installation, unloading, backup and recovery, and continuously switches kernel files until all kernel files are tested, however, this solution presents the following problems: 1. because a tester usually does not have the drive compiling capability or does not have the right to contact the compiling environment and the drive related codes, when a plurality of kernels are compiled, the drive compiling is easy to become a bottleneck; 2. the source machine usually installs dozens of kernels, and the kernels can not always pass the test, that is, the problems of downtime, deadlocking, abnormal restart and the like can be caused in the running of the automation script, and the problems are that manual intervention processing needs to be waited, and other kernel files are continuously tested after the processing is completed, so that the efficiency of testing the kernel files is low.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention mainly aims to provide a kernel file testing method, a kernel file testing device, kernel file testing equipment and a storage medium, and aims to solve the technical problem that when a plurality of kernel files are tested in the prior art, one kernel file fails to be tested, so that other kernel files cannot be tested continuously, and the efficiency of testing the kernel files is low.
In order to achieve the above object, the present invention provides a kernel file testing method, which comprises the following steps:
acquiring a kernel file to be tested and a kernel dependency header file;
when the kernel file to be tested is a newly added kernel file, automatically compiling a corresponding drive file according to the kernel dependency header file;
constructing a target timing backup plan according to the driving file and the target automation test script;
and testing the kernel file to be tested through the target timing backup plan and the target automatic installation and uninstallation script according to a kernel guide sequence.
Optionally, the testing the kernel file to be tested according to the kernel boot order through the target timed backup plan and the target automatic installation and uninstallation script includes:
when the number of the kernel files to be tested is multiple, obtaining a corresponding kernel guide sequence according to the pulling time of the multiple kernel files to be tested;
determining a target test kernel file according to the kernel boot sequence and the plurality of kernel files to be tested;
acquiring a preset prompt instruction and the current state of a target virtual machine;
sending the preset prompting instruction and the current state to a target abnormity detection module so that the target abnormity detection module creates a corresponding state snapshot according to the preset prompting instruction and the current state and feeds back successful creation information;
and testing the target test kernel file through a target timing backup plan and a target automatic installation and uninstallation script according to the creation success information.
Optionally, after the target test kernel file is tested by the target timed backup plan and the target automatic installation and uninstallation script according to the creation success information, the method further includes:
creating a corresponding abnormal restart marker according to the target test kernel file;
obtaining a test result of a target test kernel file;
judging whether the test result of the target test kernel file is successful in compiling and driving loading, successful in target log backup and successful in target agent program unloading;
if so, deleting the abnormal restart mark, and testing the next test kernel file through the target timing backup plan and the target automatic installation unloading script;
and restarting the target virtual machine through a preset starting instruction until the testing of the plurality of kernel files to be tested is completed.
Optionally, the restarting, by a preset start instruction, the target virtual machine until the testing of the plurality of kernel files to be tested is completed further includes:
obtaining the test result of the next test kernel file;
when the test result of the next test kernel file is any one of conditions of compiling drive loading failure, target log backup failure or target agent program unloading failure, setting the running state of the target virtual machine as a state snapshot;
and testing the next test kernel file of the next test kernel file through the target timing backup plan and the target automatic installation and uninstallation script, and continuously executing the step of restarting the target virtual machine through a preset starting instruction until the plurality of kernel files to be tested are tested.
Optionally, the obtaining the kernel file to be tested and the kernel dependent header file includes:
automatically pulling the kernel script to the current operating system;
and when the current operating system is a Linux operating system, running the automatic pull kernel script through a target script tool to obtain a kernel file to be tested and a kernel dependency head file.
Optionally, when the kernel file to be tested is a newly added kernel file, automatically compiling a corresponding driver file according to the kernel dependency header file includes:
acquiring an installed kernel file list of a target virtual machine;
judging whether the kernel file to be tested is a newly added kernel file or not according to the installed kernel file list;
when the kernel file to be tested is a newly added kernel file, compiling the kernel dependency header file;
and determining a corresponding drive file according to the compiled kernel dependency header file.
Optionally, the constructing a target timed backup plan according to the driver file and the target automation test script includes:
pulling a target drive resource library according to the drive file to obtain a corresponding compiling drive;
running a target automation test script according to the compiling drive;
and constructing a target timing backup plan corresponding to the target virtual machine according to the operation result.
In addition, in order to achieve the above object, the present invention further provides a kernel file testing apparatus, including:
the acquisition module is used for acquiring a kernel file to be tested and a kernel dependency header file;
the automatic compiling module is used for automatically compiling the corresponding drive file according to the kernel dependency header file when the kernel file to be tested is a newly added kernel file;
the construction module is used for constructing a target timing backup plan according to the drive file and the target automation test script;
and the test module is used for testing the kernel file to be tested through the target timing backup plan and the target automatic installation and uninstallation script according to the kernel guide sequence.
In addition, in order to achieve the above object, the present invention further provides a kernel file testing device, where the kernel file testing device includes: the system comprises a memory, a processor and a kernel file testing program which is stored on the memory and can run on the processor, wherein the kernel file testing program is configured to realize the kernel file testing method.
In addition, in order to achieve the above object, the present invention further provides a storage medium, where a kernel file test program is stored, and the kernel file test program, when executed by a processor, implements the kernel file test method as described above.
The kernel file testing method provided by the invention comprises the steps of obtaining a kernel file to be tested and a kernel dependency header file; when the kernel file to be tested is a newly added kernel file, automatically compiling a corresponding drive file according to the kernel dependency header file; constructing a target timing backup plan according to the driving file and the target automation test script; testing the kernel file to be tested through the target timing backup plan and the target automatic installation and uninstallation script according to a kernel guide sequence; according to the invention, the target timing backup plan is constructed through the drive file and the target automatic test script, and the kernel file to be tested is tested through the target timing backup plan and the target automatic installation and uninstallation script according to the kernel guide sequence, so that when a plurality of kernel files to be tested are available and a certain kernel file is not tested, other kernel files can be continuously tested, and the efficiency of testing the kernel file is effectively improved.
Drawings
Fig. 1 is a schematic structural diagram of a kernel file testing device of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a first embodiment of a kernel file testing method according to the present invention;
FIG. 3 is a flowchart illustrating a kernel file testing method according to a second embodiment of the present invention;
FIG. 4 is a flowchart illustrating a kernel file testing method according to a third embodiment of the present invention;
FIG. 5 is a functional block diagram of a kernel file testing apparatus according to a first embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a kernel file testing device of a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 1, the kernel file testing apparatus may include: a processor 1001, such as a Central Processing Unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a Wireless interface (e.g., a Wireless-Fidelity (Wi-Fi) interface). The Memory 1005 may be a Random Access Memory (RAM) Memory, or may be a Non-Volatile Memory (NVM), such as a disk Memory. The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the architecture shown in FIG. 1 does not constitute a limitation of the kernel file test device, and may include more or fewer components than those shown, or some components in combination, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a storage medium, may include therein an operating system, a network communication module, a user interface module, and a kernel file test program.
In the kernel file test device shown in fig. 1, the network interface 1004 is mainly used for data communication with the network integration platform workstation; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 in the kernel file testing device of the present invention may be arranged in the kernel file testing device, and the kernel file testing device invokes the kernel file testing program stored in the memory 1005 through the processor 1001 and executes the kernel file testing method provided in the embodiment of the present invention.
Based on the hardware structure, the embodiment of the kernel file testing method is provided.
Referring to fig. 2, fig. 2 is a flowchart illustrating a kernel file testing method according to a first embodiment of the present invention.
In a first embodiment, the kernel file testing method includes the following steps:
and step S10, acquiring the kernel file to be tested and the kernel dependency header file.
It should be noted that, the execution main body of the embodiment is a kernel file testing device, and may also be other devices that can implement the same or similar functions, such as a backup server, and the like.
It should be understood that the kernel file to be tested refers to a plurality of kernel files to be tested, for example, thirty kernel files to be tested, the kernel files to be tested constitute a basic component of the operating system, and the kernel files to be tested are divided into a single kernel file to be tested, a dual kernel file to be tested, and a microkernel file to be tested.
It can be understood that the kernel dependency header file refers to a header file relied on when the kernel file is compiled, the kernel dependency header file has functions of avoiding reuse of global variables (functions) of the kernel file, preventing conflict of definitions, describing the kernel file to be tested, and the like, and the kernel dependency header file and the kernel file to be tested are in a one-to-one correspondence relationship.
Further, step S10 includes: automatically pulling the kernel script to the current operating system; and when the current operating system is a Linux operating system, running the automatic pull kernel script through a target script tool to obtain a kernel file to be tested and a kernel dependency header file.
It should be understood that the auto-pull kernel script refers to a script for auto-pulling a kernel file, and the way of pulling the kernel file is different for different operating systems, for example, when the current operating system is a Linux operating system, the kernel file to be tested and the kernel dependency header file are pulled by a target script tool, the target script tool may be a tool such as yum, apt-get, zypper, or a preset crawler policy is used to pull the kernel file to be tested and the kernel dependency header file in a target repository, the preset crawler policy refers to a policy for crawling web page data, and the target repository includes an official website and a community repository of the kernel file.
And step S20, when the kernel file to be tested is a newly added kernel file, automatically compiling a corresponding drive file according to the kernel dependency header file.
It can be understood that the driver file refers to a file for interaction between a driver device and a device, that is, the driver file is a bridge between hardware and a system, the format of the driver file includes CAT, INF, SYS, DLL, and the like, after the kernel file to be tested is obtained, it is necessary to determine whether the kernel file to be tested is a newly added kernel file, when the kernel file to be tested is determined to be the newly added kernel file, the corresponding driver file is automatically compiled according to the kernel dependent file, and the kernel file to be tested and the driver file are both stored in the specified shared path.
Further, step S20 includes: acquiring an installed kernel file list of a target virtual machine; judging whether the kernel file to be tested is a newly added kernel file or not according to the installed kernel file list; and when the kernel file to be tested is the newly added kernel file, compiling the kernel dependency header file.
It should be understood that the installed kernel file list refers to a list formed by all kernel files already installed in the virtual machine, and the kernel file to be tested and the installed kernel file list are compared to judge whether the kernel file to be tested is a newly added kernel file, if so, the kernel dependency header file is automatically compiled, and after the compiling is successful, a corresponding drive file is obtained, and the drive file is stored to an appointed sharing path.
And step S30, constructing a target timing backup plan according to the drive file and the target automation test script.
It should be understood that the target timed backup plan refers to a plan for timed backup of Data, the target timed backup calculation may be a Continuous Data Protection (CDP) backup plan, and the target automated test script refers to a script for automatically testing a kernel file, that is, when the target automated test script is run, automatic testing of the kernel file to be tested can be realized.
And step S40, testing the kernel file to be tested through the target timing backup plan and the target automatic installation and uninstallation script according to the kernel boot sequence.
It can be understood that the kernel boot sequence refers to a sequence for testing the kernel files to be tested, and the kernel boot sequence is determined by the time for pulling the kernel files to be tested, that is, the earlier the pull time is, the earlier the test is performed on the files to be tested corresponding to the pull time.
It should be understood that the process of testing the kernel file to be tested by the target timed backup plan and the target automatic installation and uninstallation script includes installing an agent program, loading, log backup and uninstalling the agent program, that is, testing the kernel file to be tested according to the kernel boot order by the target timed backup plan and the target automatic installation and uninstallation script.
In the embodiment, a kernel file to be tested and a kernel dependency header file are obtained; when the kernel file to be tested is a newly added kernel file, automatically compiling a corresponding drive file according to the kernel dependency header file; constructing a target timing backup plan according to the driving file and the target automation test script; testing the kernel file to be tested through the target timing backup plan and the target automatic installation and uninstallation script according to a kernel guide sequence; in the embodiment, the target timing backup plan is constructed through the driver file and the target automatic test script, and the kernel file to be tested is tested through the target timing backup plan and the target automatic installation and uninstallation script according to the kernel guide sequence, so that when a plurality of kernel files to be tested are available and a certain kernel file is not tested, other kernel files can be tested continuously, and the efficiency of testing the kernel files is improved effectively.
In an embodiment, as shown in fig. 3, a second embodiment of the kernel file testing method according to the present invention is proposed based on the first embodiment, and the step S30 includes:
step S301, pulling the target drive resource library according to the drive file to obtain the corresponding compiling drive.
It should be understood that the compiling driver refers to a driver for compiling a kernel file to be tested, the driver corresponds to the version of the kernel file to be tested, the target driver resource library refers to a resource library for storing the compiling driver, specifically, the disaster recovery server periodically scans an assigned shared path, when a newly added kernel file is scanned, the target driver resource library is automatically pulled according to the driver file to obtain a corresponding compiling driver, and the compiling driver is added to the driver library of the disaster recovery server.
And step S302, running the target automation test script according to the compiling driver.
It can be understood that after the compiling driver is obtained, the target automation test script is driven to run through the compiling driver, and before the target automation test script is run, the automatic pulling of the kernel script is suspended to continue pulling a new kernel version file to be tested so as to cooperate with the running of the automation test script.
Step S303, a target timing backup plan corresponding to the target virtual machine is constructed according to the operation result.
It should be understood that after the operation result of the target automated test script is obtained, the target virtual machine corresponding to the kernel file to be tested is identified according to the operation result, and then a target timing backup plan is established for the target virtual machine, that is, the target virtual machine tests the kernel file to be tested through the target automatic installation and uninstallation script according to the target timing backup plan.
In this embodiment, a target drive resource library is pulled according to the drive file to obtain a corresponding compiling drive; running a target automation test script according to the compiling drive; constructing a target timing backup plan corresponding to the target virtual machine according to the operation result; in the embodiment, the target drive resource library is pulled through the drive file, the target automation test script is operated according to the compiling drive, and the target timing backup plan corresponding to the target virtual machine is constructed based on the operation result, so that the accuracy of constructing the target timing backup plan is effectively improved.
In an embodiment, as shown in fig. 4, a third embodiment of the kernel file testing method according to the present invention is proposed based on the first embodiment, and the step S40 includes:
step S401, when a plurality of kernel files to be tested are provided, obtaining a corresponding kernel boot sequence according to the pull time of the plurality of kernel files to be tested.
It can be understood that the pulling time refers to the time for pulling the kernel file to be tested through an automatic pulling kernel script, the format of the pulling time is 'XX year/XX month/XX day XX minute: XX second', then the kernel guide book order is set according to the pulling time and the target configuration mode, the target configuration mode can be a grub/grub2 configuration mode, after the kernel file to be tested is pulled, whether the kernel file to be tested is a plurality of kernel files needs to be judged, if yes, the corresponding kernel guide order is obtained according to the pulling time of the plurality of kernel files to be tested.
Step S402, determining a target test kernel file according to the kernel boot sequence and the plurality of kernel files to be tested.
It should be understood that the target test kernel file refers to a kernel file tested first on the virtual machine, and after the kernel boot sequence is obtained, the kernel file with the earliest pull time in the multiple kernel files to be tested is taken as the target test kernel file according to the kernel boot sequence.
And step S403, acquiring a preset prompt instruction and the current state of the target virtual machine.
It can be understood that the preset prompt information refers to prompt information for prompting that the abnormal detection module needs to perform kernel file testing, and the current state refers to an operating state when the target virtual machine is not down or abnormally restarted.
Step S404, sending the preset prompting instruction and the current state to a target abnormity detection module, so that the target abnormity detection module creates a corresponding state snapshot according to the preset prompting instruction and the current state and feeds back creation success information.
It should be understood that the creation success information refers to information that the target anomaly detection module successfully creates a state snapshot corresponding to the current state, the state snapshot is created by the target anomaly detection module according to the preset prompt instruction and the current state, and the role of the anomaly detection module includes recording an anomaly restart marker and creating a state snapshot corresponding to the current state of the target virtual machine.
And S405, testing the target test kernel file through a target timing backup plan and a target automatic installation and uninstallation script according to the creation success information.
It can be understood that after the target anomaly detection module creates the state snapshot, the test of the target test kernel file is realized by running the target automatic installation and uninstallation script according to the target timing backup plan.
Further, after step S405, the method further includes: creating a corresponding abnormal restart marker according to the target test kernel file; obtaining a test result of a target test kernel file; judging whether the test result of the target test kernel file is successful in compiling and driving loading, successful in target log backup and successful in target agent program unloading; if so, deleting the abnormal restart mark, and testing the next test kernel file through the target timing backup plan and the target automatic installation unloading script; and restarting the target virtual machine through a preset starting instruction until the testing of the plurality of kernel files to be tested is completed.
It should be understood that the abnormal restart mark refers to a mark for marking a kernel file when the target virtual machine is abnormally restarted or crashed, the test result refers to a result of testing the target test kernel file, the test result includes a test pass and a test fail, when the test result of the target test kernel file is that the compiling driver loading is successful, the target log backup is successful and the target agent program unloading is successful, the target test kernel file is tested to be passed, and then the next test kernel file is tested through the target timed backup plan and the target automatic installation and unloading script.
It can be understood that the next test kernel file refers to a test kernel file which has the smallest distance from the pull time of the target test kernel file and is longer than the pull time, the preset start instruction refers to an instruction for restarting the target virtual machine, when the target test kernel file passes the test, the target virtual machine is restarted through the preset start instruction, and then the next test kernel file is continuously tested through the target timed backup plan and the target automatic installation and uninstallation script test until the plurality of kernel files to be tested are completely covered.
Further, restarting the target virtual machine through a preset starting instruction until the testing of the plurality of kernel files to be tested is completed, further comprising: obtaining the test result of the next test kernel file; when the test result of the next test kernel file is any one of conditions of compiling drive loading failure, target log backup failure or target agent program unloading failure, setting the running state of the target virtual machine as a state snapshot; and testing the next test kernel file of the next test kernel file through the target timing backup plan and the target automatic installation and uninstallation script, and continuously executing the step of restarting the target virtual machine through a preset starting instruction until the plurality of kernel files to be tested are tested.
It can be understood that, after the test result of the next test kernel file is obtained, when it is required to determine whether the test result of the next test kernel file satisfies any one of conditions of a compiling drive loading failure, a target log backup failure, or a target agent program unloading failure, that is, when the test result is a compiling drive loading failure, a target log backup failure, or a target agent program unloading failure, it indicates that the next test kernel file fails to be tested, at this time, the abnormal restart marker cannot be deleted, and the state of the target virtual machine needs to be set to the state corresponding to the state snapshot, and then the next test kernel file of the next test kernel file is continuously tested until the plurality of kernel files to be tested are completely covered.
In the embodiment, when a plurality of kernel files to be tested are available, a corresponding kernel guide sequence is obtained according to the pulling time of the plurality of kernel files to be tested, then a target test kernel file is determined according to the kernel guide sequence and the plurality of kernel files to be tested, then the target anomaly detection module creates a corresponding state snapshot according to a preset prompt instruction and the current state and feeds back the creation success information, and then the target test kernel file is tested through a target timing backup plan and a target automatic installation and uninstallation script according to the creation success information, so that the kernel files to be tested can be continuously tested when a certain test kernel file fails, and the efficiency of testing the kernel files is effectively improved.
In addition, an embodiment of the present invention further provides a storage medium, where a kernel file test program is stored on the storage medium, and the kernel file test program, when executed by a processor, implements the steps of the kernel file test method described above.
Since the storage medium adopts all technical solutions of all the embodiments, at least all the beneficial effects brought by the technical solutions of the embodiments are achieved, and no further description is given here.
In addition, referring to fig. 5, an embodiment of the present invention further provides a kernel file testing apparatus, where the kernel file testing apparatus includes:
the obtaining module 10 is configured to obtain a kernel file to be tested and a kernel dependent header file.
And the automatic compiling module 20 is configured to, when the kernel file to be tested is a newly added kernel file, automatically compile a corresponding driver file according to the kernel dependency header file.
And the building module 30 is used for building a target timing backup plan according to the drive file and the target automation test script.
And the testing module 40 is used for testing the kernel file to be tested through the target timing backup plan and the target automatic installation and uninstallation script according to the kernel boot sequence.
In the embodiment, a kernel file to be tested and a kernel dependency header file are obtained; when the kernel file to be tested is a newly added kernel file, automatically compiling a corresponding drive file according to the kernel dependency header file; constructing a target timing backup plan according to the driving file and the target automation test script; testing the kernel file to be tested through the target timing backup plan and the target automatic installation and uninstallation script according to a kernel guide sequence; in the embodiment, the target timing backup plan is constructed through the driver file and the target automatic test script, and the kernel file to be tested is tested through the target timing backup plan and the target automatic installation and uninstallation script according to the kernel guide sequence, so that when a plurality of kernel files to be tested are available and a certain kernel file is not tested, other kernel files can be tested continuously, and the efficiency of testing the kernel files is improved effectively.
It should be noted that the above-described work flows are only exemplary, and do not limit the scope of the present invention, and in practical applications, a person skilled in the art may select some or all of them to achieve the purpose of the solution of the embodiment according to actual needs, and the present invention is not limited herein.
In addition, the technical details that are not described in detail in this embodiment may refer to the kernel file testing method provided in any embodiment of the present invention, and are not described herein again.
In an embodiment, the obtaining module 10 is further configured to automatically pull the kernel script to the current operating system; and when the current operating system is a Linux operating system, running the automatic pull kernel script through a target script tool to obtain a kernel file to be tested and a kernel dependency header file.
In an embodiment, the automatic compiling module 20 is further configured to obtain an installed kernel file list of the target virtual machine; judging whether the kernel file to be tested is a newly added kernel file or not according to the installed kernel file list; when the kernel file to be tested is a newly added kernel file, compiling the kernel dependency header file; and determining a corresponding drive file according to the compiled kernel dependency header file.
In an embodiment, the building module 30 is further configured to pull the target driver repository according to the driver file to obtain a corresponding compiling driver; running a target automation test script according to the compiling drive; and constructing a target timing backup plan corresponding to the target virtual machine according to the operation result.
In an embodiment, the testing module 40 is further configured to, when there are a plurality of kernel files to be tested, obtain a corresponding kernel boot order according to the pull time of the plurality of kernel files to be tested; determining a target test kernel file according to the kernel boot sequence and the plurality of kernel files to be tested; acquiring a preset prompt instruction and the current state of a target virtual machine; sending the preset prompting instruction and the current state to a target abnormity detection module so that the target abnormity detection module creates a corresponding state snapshot according to the preset prompting instruction and the current state and feeds back successful creation information; and testing the target test kernel file through a target timing backup plan and a target automatic installation and uninstallation script according to the creation success information.
In an embodiment, the test module 40 is further configured to create a corresponding abnormal restart marker according to the target test kernel file; obtaining a test result of a target test kernel file; judging whether the test result of the target test kernel file is successful in compiling and driving loading, successful in target log backup and successful in target agent program unloading; if yes, deleting the abnormal restart mark, and testing the next test kernel file through a target timing backup plan and a target automatic installation and uninstallation script; and restarting the target virtual machine through a preset starting instruction until the testing of the plurality of kernel files to be tested is completed.
In an embodiment, the test module 40 is further configured to obtain a test result of a next test kernel file; when the test result of the next test kernel file is any one of conditions of compiling drive loading failure, target log backup failure or target agent program unloading failure, setting the running state of the target virtual machine as a state snapshot; and testing the next test kernel file of the next test kernel file through the target timing backup plan and the target automatic installation and uninstallation script, and continuously executing the step of restarting the target virtual machine through a preset starting instruction until the plurality of kernel files to be tested are tested.
Other embodiments or implementations of the kernel file testing apparatus according to the present invention can refer to the above embodiments, and are not intended to be exhaustive.
Further, it is to be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., Read Only Memory (ROM)/RAM, magnetic disk, optical disk), and includes several instructions for enabling a terminal device (e.g., a mobile phone, a computer, an all-in-one platform workstation, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A kernel file testing method is characterized by comprising the following steps:
acquiring a kernel file to be tested and a kernel dependency header file;
when the kernel file to be tested is a newly added kernel file, automatically compiling a corresponding drive file according to the kernel dependency header file;
constructing a target timing backup plan according to the driving file and the target automation test script;
and testing the kernel file to be tested through the target timing backup plan and the target automatic installation and uninstallation script according to a kernel guide sequence.
2. The method for testing the kernel file according to claim 1, wherein the testing the kernel file to be tested through the target timed backup plan and the target automatic installation and uninstallation script according to the kernel boot order comprises:
when the number of the kernel files to be tested is multiple, obtaining a corresponding kernel guide sequence according to the pulling time of the multiple kernel files to be tested;
determining a target test kernel file according to the kernel boot sequence and the plurality of kernel files to be tested;
acquiring a preset prompt instruction and the current state of a target virtual machine;
sending the preset prompting instruction and the current state to a target abnormity detection module so that the target abnormity detection module creates a corresponding state snapshot according to the preset prompting instruction and the current state and feeds back successful creation information;
and testing the target test kernel file through a target timing backup plan and a target automatic installation and uninstallation script according to the creation success information.
3. The method for testing the kernel file according to claim 2, wherein after the target test kernel file is tested by the target timed backup plan and the target automatic installation and uninstallation script according to the creation success information, the method further comprises:
creating a corresponding abnormal restart marker according to the target test kernel file;
obtaining a test result of a target test kernel file;
judging whether the test result of the target test kernel file is successful in compiling and driving loading, successful in target log backup and successful in target agent program unloading;
if so, deleting the abnormal restart mark, and testing the next test kernel file through the target timing backup plan and the target automatic installation unloading script;
and restarting the target virtual machine through a preset starting instruction until the testing of the plurality of kernel files to be tested is completed.
4. The method for testing kernel files according to claim 3, wherein the restarting the target virtual machine through the preset boot instruction until the testing of the plurality of kernel files to be tested is completed further comprises:
obtaining the test result of the next test kernel file;
when the test result of the next test kernel file is any one of conditions of compiling drive loading failure, target log backup failure or target agent program unloading failure, setting the running state of the target virtual machine as a state snapshot;
and testing the next test kernel file of the next test kernel file through the target timing backup plan and the target automatic installation and uninstallation script, and continuously executing the step of restarting the target virtual machine through a preset starting instruction until the plurality of kernel files to be tested are tested.
5. The method for testing kernel files according to claim 1, wherein the obtaining of the kernel files to be tested and the kernel dependent header files comprises:
automatically pulling the kernel script to the current operating system;
and when the current operating system is a Linux operating system, running the automatic pull kernel script through a target script tool to obtain a kernel file to be tested and a kernel dependency header file.
6. The method for testing kernel files according to claim 1, wherein when the kernel file to be tested is a newly added kernel file, automatically compiling a corresponding driver file according to the kernel dependency header file comprises:
acquiring an installed kernel file list of a target virtual machine;
judging whether the kernel file to be tested is a newly added kernel file or not according to the installed kernel file list;
when the kernel file to be tested is a newly added kernel file, compiling the kernel dependency header file;
and determining a corresponding drive file according to the compiled kernel dependency header file.
7. The kernel file testing method of claim 1, wherein said constructing a target timed backup plan from said driver file and a target automation test script comprises:
pulling a target drive resource library according to the drive file to obtain a corresponding compiling drive;
running a target automation test script according to the compiling drive;
and constructing a target timing backup plan corresponding to the target virtual machine according to the operation result.
8. A kernel file testing apparatus, comprising:
the acquisition module is used for acquiring a kernel file to be tested and a kernel dependency header file;
the automatic compiling module is used for automatically compiling the corresponding drive file according to the kernel dependency header file when the kernel file to be tested is a newly added kernel file;
the construction module is used for constructing a target timing backup plan according to the drive file and the target automation test script;
and the test module is used for testing the kernel file to be tested through the target timing backup plan and the target automatic installation and uninstallation script according to the kernel guide sequence.
9. A kernel file test device, characterized in that the kernel file test device comprises: a memory, a processor and a kernel file test program stored on the memory and executable on the processor, the kernel file test program being configured to implement the kernel file test method of any one of claims 1 to 7.
10. A storage medium having stored thereon a kernel file test program which, when executed by a processor, implements a kernel file test method according to any one of claims 1 to 7.
CN202210595956.5A 2022-05-30 2022-05-30 Kernel file testing method, device, equipment and storage medium Active CN114676069B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210595956.5A CN114676069B (en) 2022-05-30 2022-05-30 Kernel file testing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210595956.5A CN114676069B (en) 2022-05-30 2022-05-30 Kernel file testing method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114676069A true CN114676069A (en) 2022-06-28
CN114676069B CN114676069B (en) 2022-08-30

Family

ID=82079951

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210595956.5A Active CN114676069B (en) 2022-05-30 2022-05-30 Kernel file testing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114676069B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5958049A (en) * 1997-03-17 1999-09-28 International Business Machines Corporation Operating system debugger using kernel and dynamic extension with debugger drivers to support different output devices
CN105095082A (en) * 2015-08-21 2015-11-25 北京金山安全软件有限公司 application program testing method and device
CN105528292A (en) * 2015-12-07 2016-04-27 浪潮(北京)电子信息产业有限公司 Kernel unit test method and system based on kernel module
CN105930239A (en) * 2016-04-20 2016-09-07 浪潮电子信息产业股份有限公司 Computer PXE test method
CN107025104A (en) * 2016-02-02 2017-08-08 龙芯中科技术有限公司 kernel development management system and method
CN110716873A (en) * 2019-09-24 2020-01-21 北京计算机技术及应用研究所 Hardware compatibility knowledge base construction method
CN110716874A (en) * 2019-09-25 2020-01-21 北京计算机技术及应用研究所 Method for testing hardware compatibility of domestic operating system
CN112631897A (en) * 2020-12-07 2021-04-09 麒麟软件有限公司 Method for quickly debugging linux kernel
CN113485755A (en) * 2021-06-30 2021-10-08 深圳市科力锐科技有限公司 Device driver verification method, device and storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5958049A (en) * 1997-03-17 1999-09-28 International Business Machines Corporation Operating system debugger using kernel and dynamic extension with debugger drivers to support different output devices
CN105095082A (en) * 2015-08-21 2015-11-25 北京金山安全软件有限公司 application program testing method and device
CN105528292A (en) * 2015-12-07 2016-04-27 浪潮(北京)电子信息产业有限公司 Kernel unit test method and system based on kernel module
CN107025104A (en) * 2016-02-02 2017-08-08 龙芯中科技术有限公司 kernel development management system and method
CN105930239A (en) * 2016-04-20 2016-09-07 浪潮电子信息产业股份有限公司 Computer PXE test method
CN110716873A (en) * 2019-09-24 2020-01-21 北京计算机技术及应用研究所 Hardware compatibility knowledge base construction method
CN110716874A (en) * 2019-09-25 2020-01-21 北京计算机技术及应用研究所 Method for testing hardware compatibility of domestic operating system
CN112631897A (en) * 2020-12-07 2021-04-09 麒麟软件有限公司 Method for quickly debugging linux kernel
CN113485755A (en) * 2021-06-30 2021-10-08 深圳市科力锐科技有限公司 Device driver verification method, device and storage medium

Also Published As

Publication number Publication date
CN114676069B (en) 2022-08-30

Similar Documents

Publication Publication Date Title
US10303490B2 (en) Apparatus and method for optimizing startup of embedded system
US8140905B2 (en) Incremental problem determination and resolution in cloud environments
CN108399132B (en) Scheduling test method, device and storage medium
US8978015B2 (en) Self validating applications
US7185335B2 (en) Programmatic application installation diagnosis and cleaning
US10579966B1 (en) Adapting a shared project build platform to a developer plugin
US20040117414A1 (en) Method and system for automatically updating operating systems
US20070168956A1 (en) System and method for representing user processes as software packages in a software package management system
US20100218176A1 (en) Test system configuration method and system
US10579513B2 (en) Test run control method and apparatus
CN108776643B (en) Target code merging control method and system based on version control process
CN106648762B (en) Method and device for building development environment
CN114297056A (en) Automatic testing method and system
CN113157303A (en) Upgrading method, embedded system, terminal and computer storage medium
CN113485755B (en) Device driver verification method, device and storage medium
CN111698558A (en) Television software upgrading method, television terminal and computer readable storage medium
CN114676069B (en) Kernel file testing method, device, equipment and storage medium
JP2007317089A (en) System, method and program for automatically updating software
CN116303099A (en) Cross-platform rapid deployment method, device, medium and equipment for automatic test environment
CN108804239B (en) Platform integration method and device, computer equipment and storage medium
CN116880877A (en) Virtual machine enhancement tool upgrading method and device, computer equipment and storage medium
CN111984524A (en) Fault injection method, fault simulation method, fault injection device, and storage medium
CN115604307A (en) Processing method and device for upgrading log, terminal equipment and computer medium
CN111752735A (en) SDK (software development kit) abnormity troubleshooting method and device and computer readable storage medium
CN112925549A (en) System application upgrading system based on android frame

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant