Interaction-free operating system hardware compatibility testing method based on oc-hardware

By writing test scripts in Expect language in hardware compatibility testing, automated interaction is solved, and the existing testing process requires manual intervention is improved, testing efficiency and human errors are reduced.

CN120216266APending Publication Date: 2025-06-27SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510215873.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-26
Publication Date
2025-06-27

AI Technical Summary

Technical Problem

The existing hardware compatibility testing process requires manual intervention, which is time-consuming and labor-intensive and prone to human errors.

Method used

Using the hardware compatibility testing method of interactive-free operating systems based on oec-hardware, we write test scripts through the Expect language to achieve automated interaction and automate hardware compatibility testing.

Benefits of technology

Improve testing efficiency and reduce human errors. The testing process does not require manual participation, avoiding the risk of rework and waste of labor.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120216266A_ABST
    Figure CN120216266A_ABST
Patent Text Reader

Abstract

The invention discloses an interaction-free operating system hardware compatibility testing method based on oc-hardware, and relates to the field of hardware automatic testing. Comprising the steps of 1, preposed preparation: compiling an Expect test script, checking a test environment and installing a toolkit for a server of the same model, 2, modifying a configuration file: checking that the configuration file has / usr / share / oecho / lib / config / testconfig.yaml and oech.conf as hardware test item configuration file templates, configuring the file according to an actual test environment before hardware test, configuring preset parameters used in an execech.exp script file by utilizing an oech.conf file, and configuring the preset parameters used in the execech.exp script file according to the preset parameters used in the execec.exp script file by utilizing an Oech.conf file; a root user is used, a test environment is logged in, a test script is executed, and a test result is checked.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention discloses a method for testing the hardware compatibility of a non-interactive operating system based on oec-hardware, which relates to the field of hardware automation testing. Background Art

[0002] oec-hardware is a hardware compatibility testing tool provided by the openEuler community, mainly used to verify the compatibility between the server whole machine, board cards and the operating system. The test content mainly focuses on the verification of basic functions. However, the existing compatibility testing process often requires manual intervention, which is not only time-consuming and laborious, but also prone to human errors. Summary of the Invention

[0003] Aiming at the problems of the existing technology, the present invention provides a method for testing the hardware compatibility of a non-interactive operating system based on oec-hardware. Based on the oec-hardware hardware compatibility testing tool, Expect is used to implement automated interaction, and the testing efficiency is improved through automated interaction, and human errors are reduced.

[0004] The specific solution proposed by the present invention is as follows:

[0005] The present invention provides a method for testing the hardware compatibility of a non-interactive operating system based on oec-hardware, including:

[0006] Step 1: Preparatory work:

[0007] Write an Expect test script,

[0008] Check the test environment, install the tool package on servers of the same model, install oec-hardware on one as the client; install oec-hardware-server on the other as the server, and upload the exec_oech.exp script file and oech.conf file in the test script used for testing to the client server.

[0009] Step 2: Modify the configuration file: Check the configuration files / usr / share / oech / lib / config / test_config.yaml and oech.conf. / usr / share / oech / lib / config / test_config.yaml is the configuration file template for hardware test items.

[0010] Before the hardware test, configure the file according to the actual test environment, and use the oech.conf file to configure the preset parameters used in the exec_oech.exp script file.

[0011] Step 3: Execute the test: Log in to the test environment as the root user and execute the test script.

[0012] Step 4: Check the test results.

[0013] Furthermore, in step 1 of the method for testing the hardware compatibility of a non-interactive operating system based on oec-hardware, checking the test environment includes: checking whether the test environment is connected to the yum source. If the test environment cannot access the external network, configure an offline yum source to ensure the smooth download and installation of dependent packages during the hardware compatibility test.

[0014] Furthermore, in step 2 of the method for testing the hardware compatibility of a non-interactive operating system based on oec-hardware, configuring the preset parameters used in the exec_oech.exp script file includes:

[0015] Configure the gigabit network IP of the server. The gigabit network IP of the server is used to upload the test results.

[0016] Configure the test items to be skipped in the oech test, skip. Among them, the watchdog and kdump test items require restarting the system, the usb item requires manually unplugging and plugging the usb device according to the prompt, and kabiwhitelist is a test item that does not need to be tested.

[0017] Configure the timeout time, timeout, of expect in exec_oech.exp. If the script exceeds the timeout time, it will automatically exit. The unit is seconds and should be modified according to the actual board situation in the environment.

[0018] Furthermore, in step 4 of the method for testing the hardware compatibility of a non-interactive operating system based on oec-hardware, it specifically includes:

[0019] Open the server IP address through a browser, click on the Results interface in the navigation bar, and enter through the corresponding test id to view the test results;

[0020] Find the oec-hardware test log in the / usr / share / oech / logs / directory on the client and view the test results of the corresponding test.

[0021] The present invention also provides a device for testing the hardware compatibility of a non-interactive operating system based on oec-hardware, including a pre-preparation module, a configuration module, an execution module, and a viewing module.

[0022] Pre-preparation of the pre-preparation module:

[0023] Write an Expect test script.

[0024] Check the test environment, install the tool kit on servers of the same model. Install oec-hardware on one server as the client, and install oec-hardware-server on another server as the server. Upload the exec_oech.exp script file and the oech.conf file in the test script used for testing to the client server.

[0025] The configuration module modifies the configuration files: Check that the configuration files are / usr / share / oech / lib / config / test_config.yaml and oech.conf. / usr / share / oech / lib / config / test_config.yaml is the configuration file template for hardware test items.

[0026] Before hardware testing, configure the configuration file according to the actual test environment, and use the oech.conf file to configure the preset parameters used in the exec_oech.exp script file.

[0027] The execution module executes the test: Use the root user to log in to the test environment and execute the test script.

[0028] The viewing module views the test results.

[0029] Furthermore, the pre-preparation module of the non-interactive operating system hardware compatibility test device based on oec-hardware checks the test environment, including: checking whether the test environment is connected to the yum source. If the test environment does not access the external network, configure the offline yum source to ensure the smooth download and installation of dependent packages in the hardware compatibility test.

[0030] Furthermore, the configuration module of the non-interactive operating system hardware compatibility test device based on oec-hardware configures the preset parameters used in the exec_oech.exp script file, including:

[0031] Configure the gigabit network IP of the server. The gigabit network IP of the server is used to upload the test results.

[0032] Configure the test items to be skipped skip in the oech test. Among them, the watchdog and kdump test items require restarting the system, the usb item requires manually unplugging and plugging the usb device according to the prompt, and kabiwhitelist is the test item that does not need to be tested.

[0033] Configure the timeout time timeout of expect in exec_oech.exp. The script will automatically exit after exceeding the timeout time. The unit is seconds and needs to be modified according to the actual board card situation in the environment.

[0034] Furthermore, the viewing module of the non-interactive operating system hardware compatibility testing device based on oec-hardware opens the server IP address through a browser, clicks on the Results interface in the navigation bar, finds the corresponding test id and enters it to view the test results;

[0035] Find the oec-hardware test log in the / usr / share / oech / logs / directory on the client side and view the test results of the corresponding test.

[0036] The beneficial effects of the present invention are:

[0037] During the process of automatically completing the compatibility testing of the InLinux operating system with hardware devices such as the server whole machine and board cards, the testing efficiency is improved and human errors are reduced. The tester can modify the configuration file to change the test content, specifically:

[0038] Support for automatically executing the operating system hardware compatibility test:

[0039] The tester can automatically execute the operating system hardware compatibility test. By simply modifying the configuration file, the hardware compatibility test can be automatically executed. The testing process does not require manual participation, avoiding the rework risk and manpower waste caused by the instability of the manual testing process.

[0040] Support for testing operating system products with multiple architectures:

[0041] The script uses the Expect language and is common on X86 and ARM architectures. The operations performed by the tester are the same, ensuring the convenience and smooth progress of the testing.

[0042] Support for selective configuration of test scripts;

[0043] By configuring the relevant parameters of the script, different test contents can be configured, meeting the diverse environmental requirements. Different board card test sets can be used in different environments, making the testing more flexible and controllable. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 It is a schematic diagram of the method flow of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0045] Expect is a programming tool language written by Don Libes in 1990, mainly used to process interactive processes and automate them. Through Expect, scripts can be written to simulate user input and responses, thereby achieving automated control of interactive applications.

[0046] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments, so that those skilled in the art can better understand the present invention and be able to implement it, but the embodiments cited do not limit the present invention.

[0047] Embodiment 1

[0048] The present invention provides a method for testing the hardware compatibility of an interaction-free operating system based on oec-hardware, including:

[0049] Step 1: Preliminary preparation:

[0050] Write an Expect test script,

[0051] Check the test environment, install the tool package on servers of the same model, install oec-hardware on one as the client; install oec-hardware-server on the other as the server, and upload the exec_oech.exp script file and oech.conf file in the test script used for testing to the client server. For example, on the client: yuminstall oec-hardware expect–y;

[0052] On the server: yuminstall oec-hardware-server-y

[0053] systemctl start oech-server.service

[0054] systemctl start nginx.service

[0055] systemctl stop firewalld

[0056] setenforce 0

[0057] Among them, checking the test environment includes: checking whether the test environment is connected to the yum source. If the test environment is not connected to the external network, configure the offline yum source to ensure the smooth download and installation of dependent packages in the hardware compatibility test.

[0058] Step 2: Modify the configuration file: Check the configuration files / usr / share / oech / lib / config / test_config.yaml and oech.conf. / usr / share / oech / lib / config / test_config.yaml is the configuration file template for hardware test items,

[0059] Before hardware testing, configure the actual test environment configuration file according to the actual situation, and use the oech.conf file to configure the preset parameters used in the exec_oech.exp script file.

[0060] Among them, when configuring the preset parameters used in the exec_oech.exp script file in step 2, it includes:

[0061] Configure the gigabit network IP of the server. The gigabit network IP of the server is used to upload test results.

[0062] Configure the test items to be skipped skip in oech testing. Among them, the watchdog and kdump test items require restarting the system, the usb item requires manually unplugging and plugging the usb device according to the prompt, and kabiwhitelist is a test item that does not need to be tested. Based on the above principles, users can add the skipped test items after the above items and connect them with "|".

[0063] Configure the timeout time timeout of expect in exec_oech.exp. If the time exceeds the timeout time, the script will automatically exit. The unit is seconds and needs to be modified according to the actual board situation in the environment.

[0064] Step 3: Execute the test: Use the root user to log in to the test environment and execute the test script.

[0065] After the configuration file is configured, execute the script to perform compatibility testing. During the testing process, the dependencies required for the test items will be automatically installed. Please ensure that the yum source is connected in the environment.

[0066] The script will automatically detect the test items that have been successfully tested in the current environment and automatically skip them. Each test result is based on the previous test situation. When encountering the "Do you want to submit last result?" prompt, the test result will be automatically submitted and the test will exit.

[0067] If you need to test all the test items, you need to execute the oech--clean command to clear the data before executing the test.

[0068] During the testing process, if you want to view the test process, you can view the nohup.out file. The interactive output of exec_oech.exp is output to this file. You can view the pre-filled parameters in the script and the output process of oech.

[0069] The automated testing process only includes test items that do not require a high degree of manual participation. For the test items that need to restart the server or require a high degree of manual parameters among the above skipped test items, they need to be retested separately.

[0070] Step 4: View the test results. Specifically, it includes:

[0071] Open the server IP address through the browser, click on the Results interface in the navigation bar, find the corresponding test ID and enter to view the test results;

[0072] Find the oec-hardware test log in the / usr / share / oech / logs / directory on the client side and view the test results of the corresponding test.

[0073] Embodiment 2

[0074] The present invention also provides a non-interactive operating system hardware compatibility testing device based on oec-hardware, including a pre-preparation module, a configuration module, an execution module, and a viewing module.

[0075] Pre-preparation of the pre-preparation module:

[0076] Write an Expect test script.

[0077] Check the test environment, install the tool package on servers of the same model, install oec-hardware on one as the client; install oec-hardware-server on the other as the server, and upload the exec_oech.exp script file and oech.conf file in the test script used for testing to the client server.

[0078] Configuration module to modify the configuration file: Check the configuration files / usr / share / oech / lib / config / test_config.yaml and oech.conf. / usr / share / oech / lib / config / test_config.yaml is the configuration file template for hardware test items.

[0079] Before hardware testing, configure the file according to the actual test environment, and use the oech.conf file to configure the preset parameters used in the exec_oech.exp script file.

[0080] Execution module to execute the test: Use the root user to log in to the test environment and execute the test script.

[0081] Viewing module to view the test results.

[0082] For the information interaction, execution process, etc. among the above-mentioned device modules, since they are based on the same concept as the method embodiment of the present invention, the specific content can be referred to the description in the method embodiment of the present invention and will not be elaborated here.

[0083] Similarly, the device of the present invention automatically completes the compatibility test process between the InLinux operating system and hardware devices such as the server whole machine and boards, thereby improving the test efficiency and reducing human errors. The tester can modify the configuration file to change the test content, specifically as follows:

[0084] Support for automatically executing the operating system hardware compatibility test:

[0085] The tester can automatically execute the operating system hardware compatibility test by simply modifying the configuration file, and the hardware compatibility test is automatically executed. The test process does not require manual participation, avoiding the rework risk and manpower waste caused by the instability of the manual test process.

[0086] Support for testing operating system products with multiple architectures:

[0087] The script uses the Expect language and is common on X86 and ARM architectures. The operations performed by the tester are the same, ensuring the convenience and smooth progress of the test.

[0088] Support for selective configuration of test scripts;

[0089] By configuring the relevant parameters of the script, different test contents can be configured, meeting the diverse environmental requirements. Different board test sets can be used in different environments, making the test more flexible and controllable.

[0090] It should be noted that not all steps and modules in the above processes and device structures are necessary, and some steps or modules can be ignored according to actual needs. The execution order of each step is not fixed and can be adjusted according to needs. The system structure described in the above embodiments can be a physical structure or a logical structure. That is, some modules may be implemented by the same physical entity, or some modules may be implemented by multiple physical entities, or some components in multiple independent devices may be jointly implemented.

[0091] The above-described embodiments are only preferred embodiments given to fully illustrate the present invention, and the protection scope of the present invention is not limited thereto. Equivalent substitutions or transformations made by those skilled in the art on the basis of the present invention are all within the protection scope of the present invention. The protection scope of the present invention is subject to the claims.

Claims

1. A method for testing hardware compatibility of an interactive operating system based on oec-hardware, characterized in that include: Step 1: Pre-preparation: Write Expect test scripts, Check the test environment, install the toolkit on the same model of server, install oec-hardware as the client on one server and oec-hardware-server as the server on the other server, upload the exec_oech.exp script file and oech.conf file in the test script to the client server, Step 2: Modify the configuration file: Check the configuration files: / usr / share / oech / lib / config / test_config.yaml and oech.conf. / usr / share / oech / lib / config / test_config.yaml is the configuration file template for the hardware test item. Before hardware testing, configure the configuration file according to the actual test environment, and use the oech.conf file to configure the preset parameters used in the exec_oech.exp script file. Step 3: Execute the test: Use the root user to log in to the test environment and execute the test script. Step 4: View the test results.

2. The method for testing the hardware compatibility of an OEC-hardware-based non-interactive operating system according to claim 1, wherein the step of checking the test environment in step 1 comprises: Check whether the test environment is connected to the yum source. If the test environment is not connected to the external network, configure an offline yum source to ensure that the dependent packages in the hardware compatibility test are successfully downloaded and installed.

3. The method for testing the hardware compatibility of an OEC-hardware-based non-interactive operating system according to claim 1, characterized in that The preset parameters used in the exec_oech.exp script file configured in step 2 include: Configure the server Gigabit IP, which is used to upload the test results. Configure the test items skipped in the oech test. The watchdog and kdump test items require a system restart. The USB item requires manual unplugging and plugging of the USB device according to the prompt. Kabiwhitelist is not a test item. Configure the timeout timeout of expect in exec_oech.exp. The script will automatically exit after the timeout time is exceeded. The unit is seconds. Modify it according to the actual board situation in the environment.

4. The method for testing the hardware compatibility of an OEC-hardware-based non-interactive operating system according to claim 1, characterized in that Step 4 specifically includes: Open the server IP address through the browser, click the Results interface in the navigation bar, find the corresponding test ID and enter to view the test results; Find the oec-hardware test log in the / usr / share / oech / logs / directory on the client and view the test results of the corresponding test.

5. A non-interactive operating system hardware compatibility testing device based on oec-hardware, characterized in that It includes pre-preparation module, configuration module, execution module and viewing module. Pre-preparation module Pre-preparation: Write Expect test scripts, Check the test environment, install the toolkit on the same model of server, install oec-hardware as the client on one server and oec-hardware-server as the server on the other server, upload the exec_oech.exp script file and oech.conf file in the test script to the client server, Configuration module modifies the configuration file: Check the configuration files: / usr / share / oech / lib / config / test_config.yaml and oech.conf. / usr / share / oech / lib / config / test_config.yaml is the configuration file template for the hardware test item. Before hardware testing, configure the configuration file according to the actual test environment, and use the oech.conf file to configure the preset parameters used in the exec_oech.exp script file. Execute the module to perform the test: Use the root user to log in to the test environment and execute the test script. View the module to view the test results.

6. The OEC-hardware-based non-interactive operating system hardware compatibility testing device according to claim 5, characterized in that The pre-preparation module checks the test environment, including: checking whether the test environment is connected to the yum source. If the test environment is not connected to the external network, configure an offline yum source to ensure that the dependent packages in the hardware compatibility test are successfully downloaded and installed.

7. The OEC-hardware-based non-interactive operating system hardware compatibility testing device according to claim 5, characterized in that The configuration module configures the preset parameters used in the exec_oech.exp script file, including: Configure the server Gigabit IP, which is used to upload the test results. Configure the test items skipped in the oech test. The watchdog and kdump test items require a system restart. The USB item requires manual unplugging and plugging of the USB device according to the prompt. Kabiwhitelist is not a test item. Configure the timeout timeout of expect in exec_oech.exp. The script will automatically exit after the timeout time is exceeded. The unit is seconds. Modify it according to the actual board situation in the environment.

8. The OEC-hardware-based non-interactive operating system hardware compatibility testing device according to claim 5, characterized in that the viewing module Open the server IP address through the browser, click the Results interface in the navigation bar, find the corresponding test ID and enter to view the test results; Find the oec-hardware test log in the / usr / share / oech / logs / directory on the client and view the test results of the corresponding test.