[go: up one dir, main page]

CN109491916B - Test method, device, equipment, system and medium for operating system - Google Patents

Test method, device, equipment, system and medium for operating system Download PDF

Info

Publication number
CN109491916B
CN109491916B CN201811341673.8A CN201811341673A CN109491916B CN 109491916 B CN109491916 B CN 109491916B CN 201811341673 A CN201811341673 A CN 201811341673A CN 109491916 B CN109491916 B CN 109491916B
Authority
CN
China
Prior art keywords
test
test case
operating system
module
case
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.)
Active
Application number
CN201811341673.8A
Other languages
Chinese (zh)
Other versions
CN109491916A (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.)
Coretek Systems Inc
Kyland Technology Co Ltd
Original Assignee
Coretek Systems Inc
Kyland 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 Coretek Systems Inc, Kyland Technology Co Ltd filed Critical Coretek Systems Inc
Priority to CN201811341673.8A priority Critical patent/CN109491916B/en
Publication of CN109491916A publication Critical patent/CN109491916A/en
Application granted granted Critical
Publication of CN109491916B publication Critical patent/CN109491916B/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/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

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

Abstract

The embodiment of the invention discloses a method, a device, equipment, a system and a medium for testing an operating system, wherein the method for testing the operating system comprises the following steps: the host searches a test case and a development environment storage path corresponding to the operating system component to be tested in the configuration file according to the operating system component to be tested selected by the user in the database server, and acquires the test case and the development environment from the database server according to the storage path; the configuration file stores the storage path of the test case corresponding to each type of operating system component in the database server; the host machine constructs an executable file of the test case based on the development environment and the test case; and the host machine issues the executable file of the test case to the target machine and receives the test result fed back by the target machine. The technical scheme of the embodiment of the invention can realize automatic and efficient test of the operating system.

Description

Test method, device, equipment, system and medium for operating system
Technical Field
The present invention relates to computer system testing technologies, and in particular, to a method, an apparatus, a device, a system, and a medium for testing an operating system.
Background
In software testing under normal conditions, a tester needs to first design a reasonable test case, realize software testing based on the test case and obtain a test result according to a preset test plan flow, and finally compare the test result with an expected result to form a software testing conclusion.
At present, the automatic black box test of the embedded software mainly uses a simulation test environment, namely the embedded software runs in a non-real hardware environment of a host machine, and a real hardware environment is replaced by simulation equipment. Different from general embedded software, an operating system is used as an operating environment of application software, and one of important functions is to manage hardware resources such as a CPU (central processing unit), a memory, peripheral equipment and the like, so that when the black box test of the operating system is carried out, a real hardware environment is used in a test environment. When the industrial server operating system performs black box testing, the industrial server operating system is closely dependent on a hardware environment and is also related to specific application partition configuration, and the current embedded software automation testing environment still fails to provide good support.
Disclosure of Invention
The embodiment of the invention provides a method, a device, equipment, a system and a medium for testing an operating system, which are used for realizing automatic and efficient testing of the operating system.
In a first aspect, an embodiment of the present invention provides a method for testing an operating system, including:
the host searches a test case and a development environment storage path corresponding to the operating system component to be tested in a database server in a configuration file according to the operating system component to be tested selected by a user, and acquires the test case and the development environment from the database server according to the storage path; the configuration file stores a storage path of the test case corresponding to each type of operating system component in the database server;
the host machine constructs an executable file of the test case based on the development environment and the test case;
and the host machine issues the executable file of the test case to a target machine and receives the test result fed back by the target machine.
In a second aspect, an embodiment of the present invention provides an apparatus for testing an operating system, configured in a host, the apparatus including:
the test case acquisition module is used for searching a test case corresponding to the component to be tested of the operating system and a storage path of a development environment in a database server in a configuration file according to the component to be tested of the operating system selected by a user, and acquiring the test case and the development environment from the database server according to the storage path; the configuration file stores a storage path of the test case corresponding to each type of operating system component in the database server;
the executable file determining module is used for constructing the executable file of the test case based on the development environment and the test case;
and the executable file issuing module is used for issuing the executable file of the test case to the target machine and receiving the test result fed back by the target machine.
In a third aspect, an embodiment of the present invention provides an electronic device, including:
one or more processors;
storage means for storing one or more programs;
when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method for testing the operating system according to any one of the embodiments of the present invention.
In a fourth aspect, an embodiment of the present invention provides a test of an operating system, including a host and a database server; the database server is used for storing test cases; the host machine adopts the electronic equipment of the fifth aspect.
In a fifth aspect, the embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for testing the operating system according to any of the embodiments of the present invention.
The embodiment of the invention provides a test method, a device, equipment, a system and a medium of an operating system, a host machine obtains a corresponding test case and a development environment from a database server through an operating system component to be tested selected by a user, the host machine constructs an executable file of the test case based on the corresponding development environment and the test case, sends the executable file of the test case to a target machine and receives a test result fed back by the target machine, and the problems that in the prior art, embedded software test only depends on the unreal hardware environment of the host machine, no support of the real hardware environment exists, the automation degree is poor are solved, and the test efficiency and the automation degree of the test operating system are improved are achieved.
Drawings
Fig. 1 is a flowchart of a method for testing an operating system according to an embodiment of the present invention;
fig. 2 is a flowchart of a method for testing an operating system according to a second embodiment of the present invention;
fig. 3 is a flowchart of a method for testing an operating system according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a testing apparatus for an operating system according to a fourth embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to a fifth embodiment of the present invention;
fig. 6a is a schematic structural diagram of a test system of an operating system according to a sixth embodiment of the present invention;
fig. 6b is a schematic structural diagram of a test system of an operating system according to a sixth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of a method for testing an operating system according to an embodiment of the present invention, where this embodiment is applicable to a case of testing an operating system, typically, the operating system is a server operating system, and the method can be executed by a testing apparatus for an operating system according to an embodiment of the present invention, where the apparatus can be implemented in a software and/or hardware manner, and can be generally integrated in various general-purpose computer devices, and is finally applied to a testing system for an operating system according to an embodiment of the present invention, as shown in fig. 1, the method for testing an operating system according to this embodiment specifically includes the following steps:
step 110, the host searches a storage path of a test case and a development environment corresponding to the component to be tested of the operating system in the configuration file according to the component to be tested of the operating system selected by the user in the database server, and acquires the test case and the development environment from the database server according to the storage path; the configuration file stores the storage path of the test case corresponding to each type of operating system component in the database server.
The operating system component to be tested is a test component selected by a user from the operating system components according to test requirements, and the operating system component to be tested comprises but is not limited to a file system, a network protocol stack and a kernel; the configuration file is stored locally in the host machine and is used for storing the storage path of the test case corresponding to each type of operating system component in the database server; in this embodiment, the test cases corresponding to the operating system components include configuration information of at least two application partitions in the target machine, where the configuration information includes, but is not limited to, process information, thread information, and storage space information, the at least two application partitions of the target machine are at least two real-time operating systems included in the server operating system, and the number of the test cases is at least two for a one-time test requirement; the development environment is an environment corresponding to the test case and used for compiling a source file of the test case to generate an executable file, for example, when a suffix of the source file of the test case is ". C", the development environment corresponding to the test case is a C language compilation environment, and the source file suffixed with ". C" can be compiled into the executable file suffixed with ". exe" by using the C language compilation environment.
In this embodiment, the host machine schedules a corresponding test case and a corresponding development environment in the database server according to the information of the to-be-tested component of the operating system and the local configuration file selected by the user, and in this process, the host machine performs communication interaction with the database server through the ethernet.
In the database server, only the test case and the test environment are stored, and the specific executable file is not stored, so that the corresponding relation in the storage process can be reduced, and the maintenance and the expansion of the database server are facilitated.
In a specific example, the operating system to-be-tested component selected by the user is a file system, and according to information recorded by the configuration file, 10 corresponding test cases in the database server are determined, wherein 7 test cases need to be compiled in the C development environment, and 7 test cases need to be compiled in the Java development environment, so that the host machine obtains the 10 test cases, the corresponding C development environment and the Java development environment.
And step 120, constructing an executable file of the test case by the host machine based on the development environment and the test case.
In this embodiment, the host determines a case construction task according to a test case to be executed, constructs an executable file of at least one test case according to at least one test case downloaded from the data server and the development environment, and stores the executable file of the generated test case in a specified directory.
The reason for this is: because some data which cannot be destroyed along with the end of file compilation may be generated in the file compilation process, and the data may affect other test cases, for example, the data is added to source files of other test cases, the executable file is built locally on the host machine instead of the database server side, and the purity of the data at the database server side can be ensured.
And step 130, the host machine issues the executable file of the test case to the target machine and receives the test result fed back by the target machine.
The target machine comprises a real hardware environment for testing the operating system, and when an executable file of a test case runs in the target machine, the hardware resource in the target machine can be called, so that the aim of real and effective testing is fulfilled.
In this embodiment, the host machine performs communication interaction with the target machine through the ethernet and the serial port, the host machine issues the executable file of the test case to the target machine, the executable file runs in the target machine, and the host machine acquires the test process information item by item from the serial port of the target machine as the test result.
In this embodiment, the test case is provided with a test procedure output code, where the test procedure output code includes a serial port print statement, and is used to output procedure result information from the serial port if the execution procedure parameter meets the code setting condition when executed, for example, the test procedure output code is set such that when the test passing condition is met, the test success identifier and the test case name are printed, and when the test passing condition is not met, the test failure identifier and the test case name are printed.
if (conditions for passing judgment test)
{
printf(“***Test Pass***%s”,casename);
}
else
{
printf(“***Test Fail***%s”,casename);
}
The embodiment of the invention provides a test method of an operating system, a host machine acquires a corresponding test case and a development environment from a database server through an operating system component to be tested selected by a user, the host machine constructs an executable file of the test case based on the corresponding development environment and the test case, sends the executable file of the test case to a target machine and receives a test result fed back by the target machine, and the problems that in the prior art, embedded software test only depends on the unreal hardware environment of the host machine, no support is provided by the real hardware environment, and the automation degree is poor are solved, and the test efficiency and the automation degree of the test operating system are improved.
Optionally, after the host obtains the test case and the development environment from the database server according to the storage path, the method further includes:
the host machine provides the number of all test cases and the name of each test case which are acquired from the database server to a user through a human-computer interaction interface;
and the host machine receives the test case appointed by the test selected by the user through the man-machine interaction interface.
The human-computer interaction interface may be an interaction interface of another called application, for example, an interaction interface of a browser is used as the human-computer interaction interface in the optional technical solution by calling a web port, or an interaction interface directly designed by a developer, for example, a human-computer interaction interface designed by loading different controls using a VB (Visual Basic, object-based programming language).
In the optional technical scheme, the host machine displays the number of all available test cases matched with the test requirements and the name of each test case to the user through a human-computer interaction interface, and the user further selects the test case specified by the test according to the actual operation requirements.
The benefits of this arrangement are: since software testing can be divided into multiple phases, it generally includes: the method comprises the following steps of unit testing, integrated testing, system testing, function testing, performance testing, pressure testing and the like, wherein different test cases exist in each testing stage, and aiming at a specific operating system component, as the function of the operating system component is not single, for example, a kernel of an operating system is mainly used for managing a memory, a file, a peripheral and system resources, and all corresponding function test cases are also various.
In a specific example, the test requirement is to test the performance of the kernel scheduling system resource of the operating system, the host provides all the test cases related to the kernel test, which are acquired from the database server, to the user through the human-computer interaction interface, and lists the number and the names of the corresponding test cases.
According to the optional technical scheme, a method for selecting the test case specified by the test is provided, so that the test cost is saved, and the test efficiency is improved.
Example two
Fig. 2 is a flowchart of a method for testing an operating system according to a second embodiment of the present invention, which is further detailed based on the first embodiment and provides specific implementation steps for a host to issue an executable file of a test case to a target machine. The following describes, with reference to fig. 2, a method for testing an operating system according to a second embodiment of the present invention, including the following steps:
step 210, the host searches a storage path of a test case and a development environment corresponding to the component to be tested of the operating system in the configuration file according to the component to be tested of the operating system selected by the user in the database server, and acquires the test case and the development environment from the database server according to the storage path; the configuration file stores the storage path of the test case corresponding to each type of operating system component in the database server.
And step 220, the host machine constructs an executable file of the test case based on the development environment and the test case.
And step 230, the process control module at the test back end of the host machine allocates a test execution task to the case execution module after the executable file of the test case is constructed.
In this embodiment, after the executable file of the test case is built, the test back-end case building module of the host machine stores the executable file of the built test case in the designated directory, and the process control module of the test back-end of the host machine distributes the test execution task to the case execution module of the test back-end of the host machine according to the build completion information fed back by the case building module.
And 240, determining the current test case by the case execution module according to the sequence of the test cases.
In this embodiment, the case execution module at the test back end of the host determines the test case to be executed currently according to the sequence of the test cases in the specified directory.
And step 250, the case execution module issues the executable file of the current test case to the target machine through the communication module of the target machine.
In this embodiment, the case execution module at the test back end of the host machine communicates with the target machine communication module through the ethernet, and when it is determined that the communication is normal, the executable file of the current test case is issued to the target machine through the target machine communication module.
And step 260, the case execution module sends a restart instruction to the target machine when receiving a test completion instruction fed back by the target machine through the target machine communication module, updates the current test cases according to the sequence of the test cases after the target machine is restarted, and returns to execute the operation of the executable file issued to the target machine until the test is finished.
In this embodiment, a serial port print statement is set at the end of the test case, and is used to output a test completion indication through a serial port when the test case is executed, for example, a code is added at the end of the test case to determine whether the test case is executed completely.
printf(“***Test End***%s”,casename)
In this embodiment, because the number of the test cases is at least two, the host needs to send a restart instruction to the target machine after the test of the current test case is completed and before the executable file of the next test case, and after the restart of the target machine is completed, the current test case is updated and issued to the target machine for execution until all the test cases specified by the current test are executed on the target machine.
The advantages of setting the target machine to restart are: after the previous test case is run, some temporary files may be left in the system of the target machine, or there are system resources that are not released, and in this case, if the next test case is directly executed, the execution result of the test case may be affected, so that the target machine needs to be restarted after the next test case is executed each time, and the execution environment of the test case each time is ensured to be clean, so that the test result is accurate.
And 270, the host machine receives the test result fed back by the target machine.
The technical solution of this embodiment is carefully described on the basis of the previous embodiment, and the host machine issues the executable file of the test case to the target machine to be further refined into specific implementation steps, and the target machine feeds back a test completion instruction after the test is completed by determining the current test case and issuing the executable file of the current test case to the target machine by using the case execution module, so that the target machine can restart and enter the test stage of the next test case, thereby improving the accuracy of the test result.
EXAMPLE III
Fig. 3 is a flowchart of a testing method for an operating system according to a third embodiment of the present invention, which further illustrates, based on the above embodiment, specific implementation steps of providing a host computer according to an operating system to-be-tested component selected by a user, searching a configuration file for a test case corresponding to the operating system to-be-tested component and a storage path of a development environment in a database server, and obtaining the test case and the development environment from the server according to the storage path, and the following describes, with reference to fig. 3, a testing method for an operating system according to a third embodiment of the present invention, including the following steps:
and 310, the testing front end of the host computer calls a browser through a web module, displays a human-computer interaction interface, and receives an operating system to-be-tested component selected by a user through the human-computer interaction interface.
In this embodiment, a web module at a test front end of a host machine is called through a port, and a web interface of a browser application is used to realize interaction between the host machine and a user, and receive an operating system to-be-tested component selected by the user and related to the test.
And step 320, testing the web module at the front end, and inquiring a storage path of the corresponding test case in the database server in the local configuration file according to the component to be tested of the operating system.
The configuration file stores a storage path of the test case corresponding to each type of operating system component in the database server, and the configuration file needs to be maintained synchronously with the database server.
In this embodiment, a mapping relationship exists between the to-be-tested component of the operating system and the corresponding test case, for example, the name of the test component is added to the name of the test case, or a corresponding relationship is formed in a serial number form, so that after the to-be-tested component of the operating system is selected, the corresponding test case can be determined, and the storage path of the corresponding test case in the database server is queried according to the local configuration file.
And step 330, the test front end sends a test case acquisition request to the database server through the back end communication module based on the storage path of the test case.
In this embodiment, the back-end communication module of the test front-end of the host machine sends the test case acquisition request to the test back-end of the host machine, and the related module of the test back-end of the host machine realizes connection with the database server, so as to acquire related data.
And 340, distributing the test case acquisition request task to a test configuration module at the test rear end through the flow control module at the test rear end of the host machine.
In this embodiment, the process control module at the test back end of the host machine distributes the test case obtaining request obtained from the test front end to the test configuration module at the test back end in the form of a download task.
Step 350, the test configuration module sends a test case acquisition request to the database server, and downloads the test case and the development environment from the database server.
In this embodiment, the test configuration module at the test back end of the host machine downloads the test case and the development environment from the database server through ethernet communication according to the test case acquisition request, and stores the test case and the development environment in a locally specified directory of the host machine.
And 360, feeding back the test case acquisition result to the process control module by the test configuration module.
In this embodiment, after downloading the test case and the development environment, the test configuration module at the test back end of the host machine feeds back the test case acquisition result to the process control module at the test back end of the host machine, where the acquisition result reflects whether the download task is completely completed, and if not, feeds back the completion ratio and the reason why the download task is not completed.
In a specific example, the test case obtaining result fed back to the process control module by the test configuration module is:
the downloading progress is 70%;
the serial numbers of the test cases which are not downloaded are 3, 7 and 16;
reasons for incompletion: no corresponding storage directory is found.
According to the feedback information, the test case which is not downloaded can be accurately positioned, the configuration file and the database server are not synchronously maintained when the test case is checked, and the storage directory is wrong.
Step 370, the host computer provides the number of all test cases and the name of each test case obtained from the database server to the user through the human-computer interaction interface.
And 380, receiving the test case appointed by the current test selected by the user through the man-machine interaction interface by the host machine.
And 390, the host machine constructs an executable file of the test case based on the development environment and the test case.
In this embodiment, a process control module at the test back end of a host machine allocates a case construction task to a case construction module at the test back end of the host machine according to a test case to be executed; the case construction module constructs an executable file of at least one test case according to at least one test case downloaded from the data server and the development environment, generates construction information, and stores the executable file of the generated test case in a specified directory after the construction is completed.
And 3100, a process control module at the test back end of the host machine allocates a test execution task to the case execution module after the executable file of the test case is constructed.
Step 3110, the case execution module determines the current test case according to the sequence of the test cases.
And 3120, the case execution module issues the executable file of the current test case to the target machine through the communication module of the target machine.
Step 3130, the case execution module sends a restart instruction to the target machine when receiving a test completion instruction fed back by the target machine through the target machine communication module, updates the current test cases according to the sequence of the test cases after the target machine is restarted, and returns to execute the operation of sending the executable file to the target machine until the test is finished.
Step 3140, the host machine receives the test result fed back by the target machine.
In this embodiment, the case execution module at the test back end of the host machine acquires test process information item by item from the serial port of the target machine through the target machine communication module, and feeds the test process information back to the process control module at the test back end of the host machine as a test result; a back-end communication module of a test front end of the host machine acquires test process information from the process control module; a report generation module at the test front end of the host machine acquires test process information from the back-end communication module and generates a test report; the report generation module converts the test report into a webpage format through a web module at the test front end of the host machine and calls a browser to display the webpage format.
The embodiment of the invention provides a test method of an operating system, wherein a host machine searches a storage path of a test case and a development environment corresponding to an operating system component to be tested in a configuration file according to the operating system component to be tested selected by a user in a database server, acquires the test case and the development environment from the server according to the storage path and further refines the steps into specific implementation steps, downloads the test case and the development environment from a target machine by using a test configuration module at the test rear end of the host machine, and feeds back the acquired result, so that the real-time monitoring of a downloading flow is realized, and the integrity and the accuracy of downloaded data are ensured.
Optionally, the host computer provides, through the human-computer interaction interface, the number of all test cases and the name of each test case acquired from the database server to the user, and receives, through the human-computer interaction interface, a test case specified by the current test selected by the user, where the test case includes:
the process control module at the test back end sends the test case acquisition result to the web module at the test front end through the back end communication module;
the web module at the front end of the test displays the name of the obtained test case through a human-computer interaction interface according to the test case obtaining result and determines a target test case selected by a user;
the web module sends the selection result of the target test case to the flow control module through the back-end communication module so as to determine the test case to be executed and the development environment.
According to the optional technical scheme, the web module, the rear-end communication module and the process control module of the testing front end of the host machine are utilized, so that the technical scheme that the user selects the specified testing case and the host machine receives the specified testing case is realized, and the user can accurately select the testing case related to the testing requirement for subsequent sending of the target machine for testing.
Specifically, the technical solution of this embodiment is described by taking an example of testing the capability of a kernel of an operating system to schedule multiple threads. The method comprises the following steps that a browser is called through a web module at the testing front end of a host machine, a man-machine interaction interface is displayed, an operating system kernel component selected by a user is received through the man-machine interaction interface, the web module queries a storage path of a corresponding test case in a database server in a local configuration file according to the kernel component selected by the user, and the storage path is determined as follows: the database server is based on the directory \ test case \ kernel component \ the test front end is based on the storage path, the test case acquisition request is sent to the test back end of the host machine through the back end communication module of the test front end of the host machine, the flow control module of the test back end distributes the task of the test case acquisition request to the test configuration module of the test back end, the test configuration module sends the test case acquisition request to the database server, after the database server responds to the request, the test cases stored in the storage path in the example and the development environments corresponding to the test cases are downloaded from the database server, in the downloading task, the number of the test cases is 20, the kernel thread scheduling cases of 3 application partitions are tested, the corresponding development environments comprise a C compiling environment and an OpenCL (Open Computing Language) compiling environment, after the test task is completed, the test configuration module feeds back a test case acquisition result to the flow control module to show that all test cases and development environments in the download task are completely downloaded and stored in a storage directory specified by the host machine, the flow control module sends the test case acquisition result to the web module through the back-end communication module, the web module arranges the acquired test case names on the human-computer interaction interface according to the test case acquisition result and the serial numbers from 1 to 20, a user selects a target test case of the test, wherein the target test case is the test case with the serial numbers from 1 to 13, the web module sends the selection result of the target test case to the flow control module through the back-end communication module to determine the test case to be executed and the development environment, and the flow control module distributes a case construction task to the case construction module at the test back end of the host machine according to the test case to be executed, the case construction module constructs executable files of 13 test cases according to the 13 test cases downloaded from the data server and corresponding development environments, construction information is generated, after the construction is completed, the executable files of the generated test cases are stored in a directory specified on a host machine, the process control module distributes test execution tasks to the case execution module at the test rear end, the case execution module determines that the first test case is the current test case according to the sequence of the test cases, the case execution module issues the executable files of the current test case to a target machine through a communication module of the target machine, and the executable files of the current test case run under the environment of the target machine.
In the running process of the test case, because the end of the test case is provided with a serial port printing statement, the serial port printing statement is used for outputting a test completion instruction through a serial port when the test case is executed, in this example, a test completion code is as follows: and when the use case execution module receives the Test completion indication fed back by the target machine through the target machine communication module, sending a restart indication to the target machine, updating a second Test case as a current Test case according to the sequence of the Test cases after the target machine is restarted, and returning an executable file to be executed to the target machine until all executable files of 13 Test cases are completely run on the target machine.
In the above test case, in addition to the test completion code, the test case further includes a test procedure output code, where the test procedure output code includes a serial port print statement, and is used to output procedure result information from the serial port if the execution procedure parameter meets the code setting condition when the test case is executed, and in this example, the test procedure output code is:
if (conditions for passing judgment test)
Figure BDA0001862726830000161
Figure BDA0001862726830000171
After each test case is executed, the case execution module acquires test process information from a serial port of the target machine through the target machine communication module, feeds the test process information back to the flow control module to serve as a test result, the back-end communication module acquires the test process information from the flow control module and sends the test process information to a report generation module at the test front end of the host machine, after all 13 test cases are executed, a test report is generated, the report generation module converts the test report into a webpage format through a web module, and a browser is called to display the test report to a user.
Example four
Fig. 4 is a schematic structural diagram of a testing apparatus of an operating system according to a fourth embodiment of the present invention, and as shown in fig. 4, the testing apparatus of the operating system includes: the test case obtaining module 410, the executable file determining module 420 and the executable file issuing module 430, wherein:
the test case obtaining module 410 is configured to search, according to the component to be tested of the operating system selected by the user, a storage path of the test case and the development environment corresponding to the component to be tested of the operating system in the database server in the configuration file, and obtain the test case and the development environment from the database server according to the storage path; the configuration file stores the storage path of the test case corresponding to each type of operating system component in the database server;
an executable file determining module 420, configured to construct an executable file of the test case based on the development environment and the test case;
the executable file issuing module 430 is configured to issue the executable file of the test case to the target machine, and receive the test result fed back by the target machine.
The embodiment of the invention provides a testing device of an operating system, a host machine acquires a corresponding test case and a development environment from a database server through an operating system component to be tested selected by a user, the host machine constructs an executable file of the test case based on the corresponding development environment and the test case, issues the executable file of the test case to a target machine and receives a test result fed back by the target machine, the problems that in the prior art, embedded software testing only depends on the unreal hardware environment of the host machine, no support is provided by the real hardware environment, and the automation degree is poor are solved, and the effects of improving the testing efficiency and the automation degree of the testing operating system are realized.
Optionally, after the test case obtaining module 410, the method further includes:
the test case quantity and name providing module is used for providing the quantity of all the test cases and the name of each test case which are acquired from the database server to a user through a man-machine interaction interface by the host machine;
and the specified test case receiving module is used for receiving the test case specified by the test selected by the user through the man-machine interaction interface by the host machine.
Optionally, the test case obtaining module 410 includes:
the receiving unit of the component to be tested is used for the testing front end of the host machine, calls a browser through a web module, displays a human-computer interaction interface and receives the component to be tested of the operating system selected by a user through the human-computer interaction interface;
the storage path query unit is used for testing a front-end web module and querying a storage path of a corresponding test case in the database server in the local configuration file according to the component to be tested of the operating system;
the acquisition request sending unit is used for sending a test case acquisition request to the database server through the back-end communication module based on the storage path of the test case inquired by the test front end;
the acquisition request distribution unit is used for the test rear end of the host machine and distributing the test case acquisition request task to the test configuration module of the test rear end through the flow control module;
the test case and development environment downloading unit is used for sending a test case obtaining request to the database server by the test configuration module and downloading the test case and the development environment from the database server;
and the acquisition result feedback unit is used for feeding back the acquisition result of the test case to the process control module by the test configuration module.
Optionally, the test case number and name providing module and the specified test case receiving module include:
the acquisition result sending unit is used for sending the acquisition result of the test case to a web module of the test front end through the back end communication module by the process control module of the test back end;
the target test case determining unit is used for the web module at the front end of the test to obtain a result according to the test case, displaying the name of the obtained test case through a human-computer interaction interface and determining the target test case selected by a user;
and the test case and development environment determining unit is used for the web module to send the selection result of the target test case to the flow control module through the back-end communication module so as to determine the test case to be executed and the development environment.
Optionally, the executable file issuing module 430 includes:
the test execution task allocation unit is used for a process control module at the test rear end of the host machine, and allocating a test execution task to the case execution module after the executable file of the test case is constructed;
the current test case determining unit is used for determining a current test case by the case executing module according to the sequence of the test cases;
the executable file issuing unit is used for the case execution module to issue the executable file of the current test case to the target machine through the target machine communication module;
and the current test case updating unit is used for sending a restart instruction to the target machine when the case execution module receives a test completion instruction fed back by the target machine through the target machine communication module, updating the current test cases according to the sequence of the test cases after the target machine is restarted, and returning to execute the operation of sending the executable file to the target machine until the test is finished.
The testing device of the operating system can execute the testing method of the operating system provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
EXAMPLE five
Fig. 5 is a schematic structural diagram of an electronic device according to a fifth embodiment of the present invention, as shown in fig. 5, the electronic device includes a processor 50 and a memory 51; the number of processors 50 in the computer device may be one or more, and one processor 50 is taken as an example in fig. 5; the processor 50 and the memory 51 in the device may be connected by a bus or other means, as exemplified by the bus connection in fig. 5.
The memory 51 is used as a computer-readable storage medium, and can be used for storing software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to a testing method of an operating system in the embodiment of the present invention (for example, the test case obtaining module 410, the executable file determining module 420, and the executable file issuing module 430 in the testing apparatus of the operating system). The processor 50 executes various functional applications of the device and data processing by executing software programs, instructions and modules stored in the memory 51, that is, implements the test method of the operating system described above.
The memory 51 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal, and the like. Further, the memory 51 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, the memory 51 may further include memory located remotely from the processor 50, which may be connected to the device over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
EXAMPLE six
Fig. 6a is a schematic structural diagram of a test system of an operating system according to a sixth embodiment of the present invention, and as shown in fig. 6a, the system includes a host 610 and a database server 620, and the host 610 and the database server 620 communicate with each other through an ethernet. The host 610 is an electronic device as described in the fifth embodiment, and is configured to implement human-computer interaction, allocate test tasks, schedule test cases and development environments, generate executable files of the test cases, send the test cases, obtain test results, and generate final test reports; the database server 620 is used for storing test cases and corresponding development environments.
The host machine 610 comprises a testing front end and a testing rear end, wherein the testing front end is connected with the testing rear end and is used for realizing human-computer interaction, namely data communication between the host machine 610 and a user; the testing back-end is used to implement data transmission and resource scheduling between the host 610 and the database server 620 and the target, as shown in fig. 6 b.
The test front-end of host 610 includes: a web module 611, a backend communication module 612, and a report generation module 613, wherein:
the web module 611 is connected to the back-end communication module 612, and is configured to receive the component to be tested of the operating system and the test case specified by the test, which are selected by the user, send a test case acquisition request to the back-end communication module 612, and display a final test report to the user.
The back-end communication module 612 is connected to the web module 611, the report generation module 613, and the test back-end, respectively, and is configured to receive the test case acquisition request sent by the web module 611, send the request to the test back-end, receive the test result data sent by the test back-end, and send the test result data to the report generation module 613.
The report generating module 613 is connected to the web module 611, and is configured to identify the received test result data with an identifier indicating whether the test is passed or not, generate a test report, and send the test report to the web module 611.
The test back-end of the host 610 includes: a flow control module 614, a test configuration module 615, a use case construction module 616, and a use case execution module 617, wherein:
the flow control module 614 is connected to the back-end communication module 612, the test configuration module 615, the use case construction module 616, and the use case execution module 617 of the test front-end, respectively, and the flow control module 614 is connected to the back-end communication module 612, and configured to feed back the test progress and the test result obtained by the test back-end to the test front-end through the back-end communication module 612; the flow control module 614 is connected to the test configuration module 615, and is configured to allocate a test case acquisition request task to the test configuration module 615; the flow control module 614 is connected to the use case constructing module 616, and is configured to allocate a use case constructing task to the use case constructing module 616 according to the test use case to be executed; the flow control module 614 is connected to the use case execution module 617, and is configured to allocate a test execution task to the use case execution module 617 after the executable file of the test use case is constructed.
The test configuration module 615 is connected to the database server 620 and the process control module 614, and configured to send a test case obtaining request to the database server 620, download a test case and a development environment from the database server 620, and feed back a test case obtaining result to the process control module 614.
The use case constructing module 616 is connected to the process control module 614, and is configured to construct an executable file according to the test case and the development environment downloaded from the data server 620, generate construction information, store the executable file of the generated test case in a specified directory, and feed back the construction progress to the process control module 614.
The use case execution module 617 is connected to the target machine and the process control module 614, and configured to issue an executable file of the test case to the target machine through the target machine communication module, control operation and restart of the target machine, receive and store information returned by the serial port of the target machine, and feed the information back to the process control module 614.
In the test system of the operating system in this embodiment, the host 610 and the database server 620 cooperate to realize favorable scheduling of the test case and the development environment, so that the test case can run in the real hardware environment of the target machine, the target machine is used as a hardware test platform of the system, and the target machine and the host are communicated through the ethernet and the serial port according to the test requirement.
EXAMPLE seven
An embodiment of the present invention further provides a storage medium containing computer-executable instructions, which when executed by a computer processor, perform a method for testing an operating system, the method including:
the host searches a test case and a development environment storage path corresponding to the operating system component to be tested in the configuration file according to the operating system component to be tested selected by the user in the database server, and acquires the test case and the development environment from the database server according to the storage path; the configuration file stores the storage path of the test case corresponding to each type of operating system component in the database server;
the host machine constructs an executable file of the test case based on the development environment and the test case;
and the host machine issues the executable file of the test case to the target machine and receives the test result fed back by the target machine.
Of course, the storage medium provided by the embodiment of the present invention and containing the computer-executable instructions is not limited to the method operations described above, and may also perform related operations in the test method of the operating system provided by any embodiment of the present invention.
From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute the methods according to the embodiments of the present invention.
It should be noted that, in the embodiment of the test apparatus for an operating system, the units and modules included in the test apparatus are merely divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (9)

1. A method for testing an operating system, comprising:
the host searches a test case and a development environment storage path corresponding to the operating system component to be tested in a database server in a configuration file according to the operating system component to be tested selected by a user, and acquires the test case and the development environment from the database server according to the storage path; the configuration file stores a storage path of the test case corresponding to each type of operating system component in the database server;
the test case corresponding to the operating system component comprises: the method comprises the steps that configuration information of at least two application partitions in a target machine comprises but is not limited to process information, thread information and storage space information, the at least two application partitions of the target machine are at least two real-time operating systems included by a server operating system, and the number of test cases is at least two aiming at one-time test requirements;
the host machine constructs an executable file of the test case based on the development environment and the test case;
the host machine issues the executable file of the test case to a target machine and receives a test result fed back by the target machine;
wherein the target machine comprises: and testing the real hardware environment of the operating system, and calling the hardware resources in the target machine when the executable file of the test case runs in the target machine.
2. The method according to claim 1, after the host computer obtains the test case and the development environment from the database server according to the storage path, further comprising:
the host machine provides the number of all test cases and the name of each test case which are acquired from the database server for the user through a human-computer interaction interface;
and the host machine receives the test case appointed by the test selected by the user through the human-computer interaction interface.
3. The method according to claim 1, wherein the host searches a storage path of a test case and a development environment corresponding to an operating system component to be tested in a configuration file according to the operating system component to be tested selected by a user in a database server, and acquires the test case and the development environment from the server according to the storage path, including:
the testing front end of the host machine calls a browser through a web module, displays a human-computer interaction interface, and receives an operating system to-be-tested component selected by a user through the human-computer interaction interface;
the web module of the test front end inquires a storage path of a corresponding test case in a database server in a local configuration file according to the component to be tested of the operating system;
the test front end sends a test case acquisition request to the database server through a back end communication module based on a storage path of a test case;
the testing back end of the host machine distributes the testing case acquisition request task to a testing configuration module of the testing back end through a flow control module;
the test configuration module sends a test case acquisition request to a database server, and downloads a test case and a development environment from the database server;
and the test configuration module feeds back the test case acquisition result to the process control module.
4. The method according to claim 2, wherein the host computer provides the number of all test cases and the name of each test case acquired from the database server to the user through a human-computer interaction interface, and receives the test case specified by the current test selected by the user through the human-computer interaction interface, including:
the process control module at the test back end sends the test case acquisition result to the web module at the test front end through the back end communication module;
the web module of the test front end displays the name of the obtained test case through a human-computer interaction interface according to the test case obtaining result and determines a target test case selected by a user;
and the web module sends the selection result of the target test case to the flow control module through the back-end communication module so as to determine the test case to be executed and the development environment.
5. The method of claim 1, wherein the host machine issues the executable file of the test case to a target machine, comprising:
the process control module at the test rear end of the host machine distributes a test execution task to the case execution module after the executable file of the test case is constructed;
the case execution module determines a current test case according to the sequence of the test cases;
the case execution module issues the executable file of the current test case to the target machine through the target machine communication module;
and the case execution module sends a restart instruction to the target machine when receiving a test completion instruction fed back by the target machine through the target machine communication module, updates the current test cases according to the sequence of the test cases after the target machine is restarted, and returns to execute the operation of the executable file to be issued to the target machine until the test is finished.
6. An apparatus for testing an operating system, configured in a host, the apparatus comprising:
the test case acquisition module is used for searching a test case corresponding to the component to be tested of the operating system and a storage path of a development environment in a database server in a configuration file according to the component to be tested of the operating system selected by a user, and acquiring the test case and the development environment from the database server according to the storage path; the configuration file stores a storage path of the test case corresponding to each type of operating system component in the database server;
the test case corresponding to the operating system component comprises: the method comprises the steps that configuration information of at least two application partitions in a target machine comprises but is not limited to process information, thread information and storage space information, the at least two application partitions of the target machine are at least two real-time operating systems included by a server operating system, and the number of test cases is at least two aiming at one-time test requirements;
the executable file determining module is used for constructing the executable file of the test case based on the development environment and the test case;
the executable file issuing module is used for issuing the executable file of the test case to a target machine and receiving a test result fed back by the target machine;
the target machine comprises a real hardware environment for testing an operating system, and the executable file of the test case calls hardware resources in the target machine when running in the target machine.
7. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement a method of testing an operating system as claimed in any one of claims 1 to 5.
8. The test system of an operating system is characterized by comprising a host machine and a database server; the database server is used for storing test cases; the host machine employs the electronic device of claim 7.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a method of testing an operating system according to any one of claims 1 to 5.
CN201811341673.8A 2018-11-12 2018-11-12 Test method, device, equipment, system and medium for operating system Active CN109491916B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811341673.8A CN109491916B (en) 2018-11-12 2018-11-12 Test method, device, equipment, system and medium for operating system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811341673.8A CN109491916B (en) 2018-11-12 2018-11-12 Test method, device, equipment, system and medium for operating system

Publications (2)

Publication Number Publication Date
CN109491916A CN109491916A (en) 2019-03-19
CN109491916B true CN109491916B (en) 2022-03-25

Family

ID=65695675

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811341673.8A Active CN109491916B (en) 2018-11-12 2018-11-12 Test method, device, equipment, system and medium for operating system

Country Status (1)

Country Link
CN (1) CN109491916B (en)

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110471809A (en) * 2019-07-31 2019-11-19 深圳中电长城信息安全系统有限公司 A kind of method and test device of test
CN110750463B (en) * 2019-10-29 2023-06-23 百度在线网络技术(北京)有限公司 Method, device, system, equipment and medium for testing small program
CN111159046B (en) * 2019-12-31 2024-04-09 斑马网络技术有限公司 Test method, test device, electronic equipment, test system and storage medium
CN113535536A (en) * 2020-04-20 2021-10-22 阿里巴巴集团控股有限公司 Testing, configuring, installing and operating method, device, electronic equipment and storage medium
CN112035346B (en) * 2020-08-25 2023-09-12 华东计算技术研究所(中国电子科技集团公司第三十二研究所) Automatic test method, system and medium based on embedded DSP operating system
CN114253514B (en) * 2020-09-24 2025-05-30 腾讯科技(深圳)有限公司 Big data application development method, device, computer equipment and storage medium
CN114338486B (en) * 2020-09-30 2025-01-24 中国移动通信有限公司研究院 Network service test deployment method, device, equipment and readable storage medium
CN112416318B (en) * 2020-11-03 2021-10-08 前海飞算云智软件科技(深圳)有限公司 Microservice development method, device, storage medium and electronic device
CN113191114B (en) * 2021-04-30 2023-11-10 北京百度网讯科技有限公司 Method and apparatus for validating a system
CN115495335A (en) * 2021-06-17 2022-12-20 龙芯中科技术股份有限公司 Target machine testing method and device, electronic equipment and readable medium
CN113342675B (en) * 2021-06-25 2022-09-20 北京紫光展锐通信技术有限公司 Mapping method and device of tested module, and testing method and system
CN113485933B (en) * 2021-07-21 2025-07-25 广联达科技股份有限公司 Automated testing method and distributed system
CN113806217B (en) * 2021-08-13 2025-03-14 阿里云计算有限公司 Kernel testing method and device
CN114416550A (en) * 2022-01-14 2022-04-29 统信软件技术有限公司 Test method and test system of operating system
CN114691496B (en) * 2022-03-02 2024-12-24 阿里巴巴(中国)有限公司 Unit testing method, device, computing equipment and medium
CN116302914A (en) * 2022-09-08 2023-06-23 北京科银京成技术有限公司 A software testing method, device, electronic equipment and storage medium
CN120066973B (en) * 2025-04-27 2025-07-08 重庆赛力斯凤凰智创科技有限公司 Testing method, system, electronic device and storage medium based on pytest architecture

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170263026A1 (en) * 2016-03-14 2017-09-14 International Business Machines Corporation Increasing readability of visualization nodes
CN107168879A (en) * 2017-05-23 2017-09-15 网易(杭州)网络有限公司 The generation method and device of centralized configuration management System Test Report
CN107688534A (en) * 2017-07-26 2018-02-13 平安科技(深圳)有限公司 Zonal testing method, apparatus, computer equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170263026A1 (en) * 2016-03-14 2017-09-14 International Business Machines Corporation Increasing readability of visualization nodes
CN107168879A (en) * 2017-05-23 2017-09-15 网易(杭州)网络有限公司 The generation method and device of centralized configuration management System Test Report
CN107688534A (en) * 2017-07-26 2018-02-13 平安科技(深圳)有限公司 Zonal testing method, apparatus, computer equipment and storage medium

Also Published As

Publication number Publication date
CN109491916A (en) 2019-03-19

Similar Documents

Publication Publication Date Title
CN109491916B (en) Test method, device, equipment, system and medium for operating system
US11659020B2 (en) Method and system for real-time modeling of communication, virtualization and transaction execution related topological aspects of monitored software applications and hardware entities
EP3285170B1 (en) Application profiling job management system, program, and method
US8839107B2 (en) Context based script generation
US9256419B2 (en) Dynamic software updates
US7886265B2 (en) Process automation system and method employing property attachment techniques
CN111190823A (en) UI automation test method, electronic device and computer readable storage medium
CN107408046B (en) System and method for provisioning cloud services across heterogeneous computing environments
US20200110695A1 (en) Dynamic integration of command line utilities
CN104679500B (en) Method and device for realizing automatic generation of entity class
CN111176801A (en) Multi-process management method, device, equipment and storage medium
US11093241B2 (en) Outlier software component remediation
CN110231956B (en) Method, system and device for constructing application program version
CN111026634A (en) Interface automation test system, method, device and storage medium
CN108540509B (en) Processing method and device of terminal browser, server and intelligent terminal
EP2672388A1 (en) Multi-processor parallel simulation method, system and scheduler
CN113495723B (en) Method, device and storage medium for calling functional component
US20030018699A1 (en) Automatic program deployment in a distributed system
CN111831301B (en) Blockchain runtime environment system and method supporting bifurcation-free upgrade
CN114860314B (en) Deployment upgrading method, device, equipment and medium based on database compatibility
US9389838B2 (en) Method for creating a computer software compiler for client server computing
CN113312592B (en) Scheduling method, device and equipment of software license and storage medium
CN113485860B (en) Data processing method, device, storage medium and fault positioning system
US9262141B1 (en) Distributed computations of graphical programs having a pattern
CN115357347A (en) Task processing method, device, equipment and medium

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
EE01 Entry into force of recordation of patent licensing contract
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20190319

Assignee: Kedong (Guangzhou) Software Technology Co., Ltd

Assignor: Beijing Dongtu Technology Co., Ltd.|Beijing keyin Jingcheng Technology Co., Ltd

Contract record no.: X2020980000255

Denomination of invention: Test method, device, equipment, system and medium for operating system

License type: Exclusive License

Record date: 20200218

GR01 Patent grant
GR01 Patent grant