A test method and test system for automatically traversing BIOS configuration options

CN122195759BActive Publication Date: 2026-09-25POWERLEADER COMPUTER SYST CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202610678685.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-05-18
Publication Date
2026-09-25
Estimated Expiration
2046-05-18

AI Technical Summary

Technical Problem

人工测试方式需要测试人员逐台进入BIOS Setup图形界面或文本界面,手动逐项修改配置参数并记录结果,存在效率低下、人力成本高、易遗漏、易出错等问题,且难以满足大规模批量测试需求

Benefits of technology

[0017]本发明实施例提供的自动化遍历BIOS配置选项的测试方法及测试系统至少具备如下的优点或者有益效果之一:通过自动化测试脚本与UEFI Shell环境的深度协同,显著提升了BIOS配置选项遍历测试的效率与可靠性。首先,通过导入并解析BIOS对应版本的配置选项描述文件,能够自动筛选目标配置项及其目标值,实现了测试需求的精准映射与灵活适配,避免了传统人工逐项查找和配置的低效与易错问题,大幅缩短了测试准备周期。其次,基于目标配置自动生成UEFI Shell环境下的执行文件,并通过SSH远程上传与自动执行,实现了从配置下发、变量修改到生效验证的全流程无人值守,极大降低了人力成本与对测试人员专业技能的依赖,同时支持对多台被测机的并行测试,显著提升了规模化测试效率。此外,该方法在UEFI Shell环境下直接修改UEFI变量来变更BIOS配置,绕过了传统图形界面或文本界面的操作限制,修改过程更加底层、稳定且不受操作系统状态影响,有效避免了因界面差异或版本迭代导致的兼容性问题。通过控制被测机重启进入操作系统进行闭环验证,确保了每一项配置修改的真实生效,形成了"修改-验证"的完整测试闭环,显著提高了测试结果的准确性与可信度。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122195759B_ABST
    Figure CN122195759B_ABST
Patent Text Reader

Abstract

The application discloses a kind of test method and test system of automatic BIOS configuration option traversal, comprising: setting up automatic test script in service machine end, and the remote management parameter of measured machine is configured by automatic test script;Import the configuration option description file of the corresponding version of measured machine BIOS, parse configuration option description file, and according to test demand, the target BIOS configuration option and the target configuration value corresponding to each target BIOS configuration option are screened;Corresponding execution file under UEFI Shell environment is generated based on each target BIOS configuration option and target configuration value, and execution file includes automatic start script and variable setting tool;Control measured machine restarts and enters UEFI Shell environment, and automatically execute automatic start script by UEFI Shell environment, and automatic start script calls variable setting tool, and target BIOS configuration option is modified to corresponding target configuration value by the way of modifying UEFI variable one by one;Control measured machine restarts and enters operating system, and verify whether target BIOS configuration option is effective.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a test method and system for automatically traversing BIOS configuration options. Background Technology

[0002] In the research, development, production, and testing of server hardware, the BIOS (Basic Input / Output System), as the core firmware connecting the hardware and the operating system, directly impacts the overall performance, compatibility, and security of the server due to the correctness and stability of its configuration options. Before the server leaves the factory or during firmware version iterations, extensive testing of the BIOS configuration options is necessary to verify the stability and compatibility of the hardware under different configuration combinations.

[0003] In related technologies, BIOS configuration option traversal testing mainly relies on manual operation or semi-automated tools. Manual testing requires testers to manually modify configuration parameters and record results on each machine via the BIOS Setup graphical or text-based interface. This approach is inefficient, labor-intensive, prone to omissions and errors, and fails to meet the needs of large-scale batch testing. Some automated solutions attempt to remotely modify BIOS configurations using AFU (American Megatrends Firmware Update) tools or SOL (Serial Over LAN) interfaces. However, AFU tools rely on specific vendor support and have limited functionality, while the SOL interface requires simulating access to the BIOS operating interface, making it highly susceptible to differences in interface versions, response timing, and network stability, resulting in insufficient compatibility and unreliable performance. Furthermore, existing methods often lack automated verification mechanisms after configuration modifications, making it difficult to form a complete testing loop and leading to insufficient credibility and traceability of test results. Summary of the Invention

[0004] This invention provides a test method and system for automating the traversal of BIOS configuration options, aiming to solve at least one of the technical problems existing in the prior art.

[0005] The technical solution of this invention is a test method for automatically traversing BIOS configuration options, which includes: Set up automated test scripts on the server side, and configure the remote management parameters of the machine under test through the automated test scripts; Import the configuration option description file corresponding to the BIOS version of the machine under test, parse the configuration option description file, and filter the target BIOS configuration options that need to be modified and the target configuration values ​​corresponding to each target BIOS configuration option according to the test requirements; Based on each target BIOS configuration option and its target configuration value, a corresponding executable file is generated in the UEFI Shell environment. The executable file includes an automated startup script and a variable setting tool. The status of the machine under test can be confirmed or controlled under the operating system state via the SSH interface; The executable file is uploaded to the UEFI system partition path of the machine under test via remote connection; The system controls the machine under test to restart and enter the UEFI Shell environment. The automated startup script is then executed automatically in the UEFI Shell environment. The automated startup script calls the variable setting tool to modify the target BIOS configuration options one by one to the corresponding target configuration values ​​by modifying UEFI variables. Control the tested machine to restart and enter the operating system to verify whether the target BIOS configuration options are effective.

[0006] According to some embodiments of the present invention, confirming or controlling the status of the machine under test to the operating system state via the SSH interface includes: Check whether the machine under test is in an operating system state via the OS SSH interface; If the device under test is not in an operating system state, remotely restart the device under test using the BMC IPMI command until the device under test enters the operating system state.

[0007] According to some embodiments of the present invention, the configuration option description file is an IntelRCSetup.i format file, which includes the GUID corresponding to each BIOS configuration option.

[0008] According to some embodiments of the present invention, the step of generating the corresponding executable file in the UEFI Shell environment based on each target BIOS configuration option and its target configuration value includes: Extract the corresponding variable name, GUID, offset address, data type, and target configuration value from the configuration option description file based on the current target BIOS configuration options; Based on the GUID, the offset address, the data type, and the target configuration value, a corresponding executable file in the UEFI Shell environment is generated. The executable file in the UEFI Shell environment contains a sequence of commands that sequentially call the variable setting tool RakSetvariable.efi and an automated startup script startup.nsh. Each RakSetvariable.efi command sequence is used to set a UEFI variable. Each command in the RakSetvariable.efi command sequence specifies a variable name, GUID, offset address, data type, and target configuration value. The startup.nsh command sequence includes a command to set the BootOrder variable, a cleanup command to delete the variable setting tool after the configuration is modified, a prompt command to output completion information, and a restart command to restart the system to make the configuration take effect.

[0009] According to some embodiments of the present invention, controlling the device under test to restart and enter the UEFI Shell environment includes: Send a forced UEFI boot command to the device under test via the BMC IPMI interface; The forced UEFI boot command controls the device under test to restart, enabling the device under test to enter the UEFI Shell environment; wherein, the UEFI Shell environment automatically detects and executes the automated boot script under the UEFI system partition path during startup.

[0010] According to some embodiments of the present invention, modifying the target BIOS configuration options one by one to the corresponding target configuration values ​​by modifying UEFI variables includes: It receives fields containing variable name, GUID, offset address, data type, and target configuration value; After the machine under test boots into the UEFI Shell environment, it automatically loads and executes the startup.nsh command sequence; In the UEFI variable storage space, the startup.nsh command sequence of the automated startup script calls the RakSetvariable.efi command sequence of the variable setting tool to locate the BIOS configuration data area corresponding to the variable name, the GUID, the offset address, and the data type, and modifies the BIOS configuration options item by item to write the target configuration value to the specified offset position; Record the results of each of the above operations to a log file.

[0011] According to some embodiments of the present invention, verifying whether the target BIOS configuration option is effective includes: Remotely log in to the operating system of the machine under test via SSH and send a BIOS configuration read command; In response to the BIOS configuration read command, the current BIOS configuration value of the machine under test is obtained; The current BIOS configuration value of the tested machine is compared with the target configuration value; if they match, the BIOS configuration modification is considered successful; if they do not match, the BIOS configuration modification is considered unsuccessful.

[0012] According to some embodiments of the present invention, it further includes: Once the BIOS configuration modification is determined to be successful, the test environment is cleaned up in response to the cleanup command, and a test report is generated. If the BIOS configuration modification fails, the error information is recorded, and the process proceeds to the target BIOS configuration option retry stage. In the target BIOS configuration option retry phase, the BIOS configuration value is recorded each time. If the number of retries for BIOS configuration modification reaches a preset value and there is still no BIOS configuration value that matches the target configuration value, the test is terminated.

[0013] According to some embodiments of the present invention, uploading the executable file to the UEFI system partition path of the device under test via remote connection includes: Use SFTP or SCP tools to upload the startup.nsh command sequence and the RakSetvariable.efi command sequence to the / boot / efi directory of the machine under test; The scp command is executed to copy the executable file from the server to the specified directory of the UEFI system partition path of the machine under test; On the machine under test, execute md5sum or sha256sum to verify the integrity of the executable file; Compare the hash values ​​of the executable file on the server and the executable file on the tested machine to ensure that the executable files are consistent.

[0014] This invention also provides a test system for automatically traversing BIOS configuration options, used to implement the methods described in the above embodiments, comprising: A server machine is used to deploy automated test scripts to generate executable files, control the status of the machine under test, upload executable files, and verify configurations. A device under test communicates with the server via the BMC and OS SSH interfaces, supporting UEFI Shell environment and BIOS configuration modification; The server interacts with the machine under test via SSH and IPMI protocols to complete the automated traversal test of BIOS configuration options.

[0015] The present invention also relates to a computer device, including a memory and a processor, wherein the processor performs the above-described method when executing a computer program stored in the memory.

[0016] The present invention also relates to a computer-readable storage medium storing computer program instructions thereon, which, when executed by a processor, implement the above-described method.

[0017] The automated BIOS configuration option traversal testing method and system provided in this invention have at least one of the following advantages or beneficial effects: Through deep collaboration between automated test scripts and the UEFI Shell environment, the efficiency and reliability of BIOS configuration option traversal testing are significantly improved. First, by importing and parsing the configuration option description file for the corresponding BIOS version, target configuration items and their target values ​​can be automatically filtered, achieving precise mapping and flexible adaptation of test requirements. This avoids the inefficiency and error-prone nature of traditional manual item-by-item searching and configuration, significantly shortening the test preparation cycle. Second, based on the target configuration, an executable file in the UEFI Shell environment is automatically generated and uploaded and automatically executed remotely via SSH. This achieves unattended operation throughout the entire process from configuration distribution and variable modification to effectiveness verification, greatly reducing labor costs and reliance on the professional skills of testers. It also supports parallel testing of multiple machines under test, significantly improving the efficiency of large-scale testing. Furthermore, this method directly modifies UEFI variables to change the BIOS configuration in the UEFI Shell environment, bypassing the operational limitations of traditional graphical or text-based interfaces. The modification process is more low-level, stable, and unaffected by the operating system state, effectively avoiding compatibility issues caused by interface differences or version iterations. By controlling the machine under test to restart and enter the operating system for closed-loop verification, the actual effect of each configuration modification is ensured, forming a complete "modification-verification" test closed loop, which significantly improves the accuracy and reliability of the test results.

[0018] Furthermore, additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description

[0019] Figure 1 This is a flowchart of an automated traversal of BIOS configuration options testing method provided in an embodiment of the present invention; Figure 2 This is a detailed flowchart of step S600 in the test method for automatically traversing BIOS configuration options provided in this embodiment of the invention; Figure 3 This is a detailed flowchart of step S700 in the test method for automatically traversing BIOS configuration options provided in this embodiment of the invention; Figure 4 This is a detailed flowchart of a testing method for automatically traversing BIOS configuration options provided in an embodiment of the present invention; Figure 5This is a detailed flowchart of step S500 in the test method for automatically traversing BIOS configuration options provided in this embodiment of the invention; Figure 6 This is a GUI style interface diagram of the first parameter configuration provided in the embodiments of the present invention; Figure 7 This is a GUI style interface diagram of the second parameter configuration provided in the embodiment of the present invention. Detailed Implementation

[0020] The following will provide a clear and complete description of the concept, specific structure, and technical effects of the present invention in conjunction with the embodiments and accompanying drawings, so as to fully understand the purpose, solution, and effects of the present invention.

[0021] It should be noted that, unless otherwise specified, when a feature is referred to as "fixed" or "connected" to another feature, it can be directly fixed or connected to the other feature, or indirectly fixed or connected to the other feature. The singular forms "a," "described," and "the" used herein are also intended to include the plural forms, unless the context clearly indicates otherwise. Furthermore, unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in this specification is for the purpose of describing particular embodiments only and not for limiting the invention. The term "and / or" as used herein includes any combination of one or more of the associated listed items.

[0022] It should be understood that although the terms first, second, third, etc., may be used to describe various elements in this disclosure, these elements should not be limited to these terms. These terms are used only to distinguish elements of the same type from one another. For example, a first element may also be referred to as a second element without departing from the scope of this disclosure, and similarly, a second element may also be referred to as a first element. Any and all instances or exemplary language (“e.g.,” “such as,” etc.) provided herein are intended only to better illustrate embodiments of the invention and, unless otherwise required, do not impose a limitation on the scope of the invention.

[0023] This invention provides a test method and system for automating the traversal of BIOS configuration options, achieving high efficiency, automation, remote access, and accuracy in BIOS configuration traversal testing, reducing labor costs, and effectively ensuring the stability and compatibility testing quality of server hardware under different BIOS configuration combinations.

[0024] Reference Figure 1 As shown, Figure 1This is a flowchart illustrating the overall process of an automated traversal test method for BIOS configuration options provided in this embodiment of the invention. The automated traversal test method for BIOS configuration options includes, but is not limited to, steps S100 to S700. Specifically, S100: Set up an automated test script on the server side and configure the remote management parameters of the machine under test through the automated test script; S200: Import the configuration option description file of the corresponding version of the BIOS of the machine under test, parse the configuration option description file, and filter the target BIOS configuration options to be modified and the target configuration values ​​corresponding to each target BIOS configuration option according to the test requirements; S300: Generates an executable file in the UEFI Shell environment based on each target BIOS configuration option and its target configuration value. The executable file includes an automated startup script and a variable setting tool. S400: The status of the device under test can be confirmed or controlled to the operating system state via the SSH interface; S500: Upload the executable file to the UEFI system partition path of the machine under test via remote connection; S600: Controls the tested machine to restart and enter the UEFI Shell environment. The automated startup script is automatically executed through the UEFI Shell environment. The automated startup script calls the variable setting tool to modify the target BIOS configuration options one by one to the corresponding target configuration values ​​by modifying UEFI variables. S700: Controls the tested machine to restart and enter the operating system, verifying whether the target BIOS configuration options are effective.

[0025] In this embodiment of the invention, by pre-configuring remote management parameters on the device under test (DUT) and using the SSH interface to remotely confirm and control the DUT's status and remotely upload executable files, the entire BIOS testing process is remotely automated, eliminating the need for on-site physical intervention by test personnel. This significantly reduces the reliance on physical space and manual on-site operation, supports remote centralized management and parallel testing of multiple DUTs, and greatly improves the scalability and management efficiency of the testing scenario.

[0026] By importing and parsing the configuration option description file of the corresponding version of the BIOS of the machine under test, the BIOS configuration options are represented digitally and in a structured manner. This allows the test system to automatically and accurately select the target BIOS configuration options and their target configuration values ​​that need to be modified based on test requirements. This ensures the completeness and accuracy of test coverage.

[0027] Based on the target BIOS configuration options and their target configuration values, a UEFI Shell executable file containing automated startup scripts and variable setting tools is automatically generated, realizing the pre-compilation and standardized encapsulation of BIOS configuration modification commands. This enables configuration modification tasks to be executed automatically and in batches within the UEFI Shell environment, eliminating the need for manual operation in the BIOSSetup graphical interface and removing the time overhead and operational errors of manual operation.

[0028] By controlling the device under test to enter the UEFI Shell environment, and having an automated startup script call a variable setting tool to modify UEFI variables one by one to the corresponding target configuration values, the BIOS configuration is directly and accurately written at the underlying firmware level. Compared to traditional modification methods that rely on AFU tools or SOL interfaces (AFU requires tool support, and SOL requires simulating BIOS entry), this invention directly modifies the configuration by generating an executable file (such as startup.nsh) in the UEFI Shell environment, without relying on specific tools or interfaces, making the operation more flexible and compatible. Furthermore, compared to the traditional manual modification method through the BIOS Setup interface, this technique bypasses the operational limitations of the graphical interface and potential human errors, ensuring the accuracy and consistency of configuration value modifications. At the same time, the isolation between the UEFI Shell environment and the operating system environment avoids the impact of the configuration modification process on the stability of the operating system, improving the security and controllability of the testing process.

[0029] The test system controlled the machine under test to restart and enter the operating system state, verifying whether the target BIOS configuration options were effective, thus constructing a complete closed-loop test chain of "configuration modification → system restart → effectiveness verification". This ensures that every BIOS configuration modification is validated in the actual operating environment, avoiding test omissions caused by configuration modifications not taking effect or taking effect abnormally, significantly improving the reliability and credibility of the test results, and providing an accurate basis for judging the quality of BIOS firmware.

[0030] This invention establishes a complete automated testing loop, encompassing remote environment preparation, configuration parsing, script generation, file transfer, automated modification, and effectiveness verification. It transforms the traditional BIOS configuration traversal test, which relies heavily on manual on-site operations, into an intelligent testing process that can be remotely scheduled, fully automated, and with verifiable results. This significantly improves testing efficiency while also enhancing test coverage, accuracy, repeatability, and scalability, effectively solving the technical problems of low efficiency, high labor costs, and susceptibility to omissions and errors in existing BIOS configuration traversal tests.

[0031] It should be noted that in this embodiment of the invention, the automated test script supports embedding other test items, and the function of modifying BIOS options can be called as an independent interface, which is convenient for integration with other test modules to form a modular test framework and meet diverse test needs.

[0032] In addition, the test environment of this embodiment only requires two machines (the machine under test, SUT, and the server, TAS), and supports remote management via BMC and OS IP, making it suitable for different physical or virtualized environments and reducing test deployment costs.

[0033] In some embodiments of the present invention, step S400 of the test method for automatically traversing BIOS configuration options, which involves confirming or controlling the state of the machine under test to the operating system state via an SSH interface, includes, but is not limited to, steps S410 and S420. Specifically, S410: Checks whether the device under test is in an operating system state via the OS SSH interface; S420: If the device under test is not in an operating system state, remotely restart the device under test using the BMC IPMI command until the device under test enters the operating system state.

[0034] By actively probing the operating system status of the machine under test through the OS SSH interface, accurate remote identification of the current status (operating system status / non-operating system status) of the machine under test is achieved, avoiding subsequent file transfer failures due to misjudgment of status.

[0035] When the device under test (DUT) is not in an operating system state, remote restart is performed via BMC IPMI commands. This utilizes an out-of-band management channel independent of the DUT's operating system and main CPU to achieve forced control over the DUT's power state. Even if the DUT's operating system crashes, hangs, or becomes unresponsive due to preceding test operations, BMC IPMI commands can still reliably execute remote restart operations. This overcomes the limitations of traditional restarts that rely on internal operating system instructions, ensuring the reliability and independence of the test system's control over the DUT's state recovery.

[0036] By repeatedly performing status checks and remote restarts until the device under test (DUT) is confirmed to have entered the operating system state, an automated state recovery closed-loop mechanism is constructed. This mechanism can adaptively handle situations where the DUT fails to enter the operating system on the first restart due to various abnormal reasons (such as abnormal startup items, hardware self-test delays, etc.), realizing automatic fault tolerance and self-recovery of the test process when faced with abnormal DUT states, without requiring on-site intervention or manual restart by test personnel, significantly improving the robustness and continuity of the automated test process.

[0037] In some embodiments of the present invention, the configuration option description file is an IntelRCSetup.i format file, which includes the GUID corresponding to each BIOS configuration option.

[0038] The configuration option description file adopts the IntelRCSetup.i format and contains the GUID corresponding to each BIOS configuration option, realizing a precise one-to-one mapping between BIOS configuration options and underlying UEFI variables. The globally unique GUID identifier avoids confusion caused by differences or duplicate names of options across different BIOS versions or platforms, ensuring accurate location of the target configuration option. Simultaneously, as a standard identifier in the UEFI variable system, the GUID allows the parsed configuration information to be directly used for subsequent UEFI variable read / write operations without additional option name conversion or address lookup, significantly improving the accuracy and efficiency of configuration modifications and enhancing the method's universality and portability across different Intel platform BIOS versions.

[0039] In some embodiments of the present invention, step S300 of the test method for automatically traversing BIOS configuration options, which generates an executable file in the UEFI Shell environment based on each target BIOS configuration option and its target configuration value, includes, but is not limited to, steps S310 to S320. Specifically, S310: Extract the corresponding variable name, GUID, offset address, data type and target configuration value from the configuration option description file based on the current target BIOS configuration option; S320: Generates the corresponding executable file in the UEFI Shell environment based on GUID, offset address, data type and target configuration value. The executable file in the UEFI Shell environment contains the command sequence of RakSetvariable.efi which calls the variable setting tool in sequence and the command sequence of startup.nsh which calls the automated startup script. Each RakSetvariable.efi command sequence is used to set a UEFI variable. Each command in the RakSetvariable.efi command sequence specifies a variable name, GUID, offset address, data type, and target configuration value. The startup.nsh command sequence includes a command to set the BootOrder variable, a cleanup command to delete the variable setting tool after the configuration is modified, a prompt command to output completion information, and a restart command to restart the system to make the configuration take effect.

[0040] In this embodiment of the invention, by directly extracting low-level variable attributes such as GUID, offset address, and data type from the IntelRCSetup.i format file, a precise mapping from BIOS configuration options to the physical storage location of UEFI variables is achieved. Compared to surface-level configuration methods that rely solely on option names, this technique penetrates the abstraction layer of the BIOS Setup interface and directly locates the storage metadata of UEFI firmware variables. This ensures that subsequent configuration modifications accurately apply to the specific offset location of the target variable, avoiding configuration misalignment caused by ambiguity in option names or differences in interface hierarchy, and significantly improving the accuracy and reliability of configuration modifications.

[0041] By encapsulating the GUID, offset address, data type, and target configuration value into a standardized command sequence called RakSetvariable.efi, BIOS configuration modification commands are generated at a low level and atomically. Each command independently sets a UEFI variable, allowing complex configuration tasks to be broken down into fine-grained operations that can be precisely controlled and executed line by line, facilitating step-by-step debugging, error location, and exception rollback. At the same time, the standardized format of the command sequence ensures execution consistency across different configuration options and different machines under test, eliminating the risks of format differences and syntax errors associated with manually written commands.

[0042] The startup.nsh script integrates multiple functions such as startup order control, tool cleanup, status prompts, and system restart, achieving automated orchestration of the entire configuration modification process in the UEFI Shell environment. Setting the BootOrder variable ensures that the system can boot into the verification environment according to the expected path after configuration modification; the cleanup command automatically deletes the variable setting tool after the task is completed, avoiding tool residues from interfering with system security or subsequent testing; the prompt command provides observable execution progress feedback, facilitating remote monitoring and log traceability; and the restart command connects the configuration modification and effectiveness verification, forming a closed loop.

[0043] The combination of metadata extraction, command sequence generation, and automated script orchestration technologies has built a full-link automated conversion mechanism from high-level configuration requirements to low-level UEFI variable operations. This transforms the traditional complex operation of manually writing UEFI commands one by one and manually controlling the boot order and restart into an intelligent process based on automatic parsing, batch generation, and one-click execution of description files. While ensuring the accuracy of low-level configuration modifications, it also achieves standardized, remote, and unattended testing and deployment, effectively solving the problems of high technical threshold, cumbersome operation, and error-proneness in automating BIOS configuration modifications in UEFI environments.

[0044] In some embodiments of the present invention, executing a sequence of multiple RakSetvariable.efi commands includes: Multiple UEFI variables can be set by invoking the RakSetvariable.efi command sequence of the variable setting tool, as follows: Set IntelSetup variables: GUID: ec87d643-eba4-4bb5-a1e5-3f3e36b20da9 Offset (-offset): 148,150,156,140 Value (-value): 01,02,03 (or other specific values, set by offset) Data type (-type): 8,8,8,8 Output log file: setvar.log This can be achieved using the following code: ## Configure IntelSetup variables RakSetvariable.efi IntelSetup \ -guid ec87d643-eba4-4bb5-a1e5-3f3e36b20da9 \ -offset 148,150,156,140 \ -value 01,02,02,03 \ # Note that this is corrected to have 4 values ​​corresponding to 4 offsets -type 8,8,8,8 >> setvar.log Set the MeRcConfiguration variable: GUID: 2b26358d-f899-41c4-9bc2-82a338b993d8 Offset: 41,42 Value: 01,01 Data type: 8,8 Output log file: setvar.log This can be achieved using the following code: ## Configure MeRcConfiguration variables RakSetvariable.efi MeRcConfiguration\ -guid 2b26358d-f899-41c4-9bc2-82a338b993d8 \ -offset 41,42 \ -value 01,01 \ -type 8,8 >> setvar.log Set the MeSetupStorage variable: Specify the GUID, offset, value, and data type to log the information.

[0045] This can be achieved using the following code: ## Configure MeSetupStorage variables RakSetvariable.efi MeSetupStorage \ -guid 2b26358d-f899-41c4-9bc2-82a338b993d8 \ -offset 9 \ -value 01 \ -type 8 >> setvar.log Set the SocketIoConfig variable: Specify the new GUID and parameters, and perform variable settings.

[0046] This can be achieved using the following code: ## Configure SocketIoConfig variables RakSetvariable.efi SocketIoConfig \ -guid dd84017e-7f52-48f9-b16e-50ed9e0dbe27 \ -offset 10099,10100 \ -value 01,01 \ -type 8,8 >> setvar.log Set the SocketMpLinkConfig variable: Use the tool to set relevant configurations and record them in the log.

[0047] This can be achieved using the following code: ## Configure SocketMpLinkConfig variables RakSetvariable.efi SocketMpLinkConfig \ -guid 2b9b22de-2ad4-4abc-957d-5f18c504a05c \ -offset 26 \ -value 00 \ -type 8 >> setvar.log Set the SocketProcessorCoreConfig variable: Configure the processor core parameters.

[0048] This can be achieved using the following code: ## Configure SocketProcessorCoreConfig variables RakSetvariable.efi SocketProcessorCoreConfig \ -guid 07013588-C789-4E12-A7C3-88FAFAE79F7C \ -offset 37,33 \ -value 00,00 \ -type 8,8 >> setvar.log Next, set the boot order (BootOrder) for multiple RakSetvariable.efi command sequences. Use the `setvar` command to set the BootOrder variable: GUID: 8BE4DF61-93CA-11D2-AA0D-00E098032B8C Value: H4C004800490044004F000000 (Startup sequence data in hexadecimal format) Cleanup operation: Delete the RakSetvariable.efi file: Use the rm command to delete the RakSetvariable.efi file to avoid leaving any remnants.

[0049] Output completion information: Using the `echo` command to output "finish" will indicate that the script has finished executing.

[0050] Stop execution: Use the `stall 15000000` command to pause for a period of time (in microseconds, approximately 15 seconds) to ensure all operations are completed.

[0051] Reset the system: Use the reset command to restart the system and make the new configuration take effect.

[0052] Based on the above operations of batch executing multiple UEFI variable settings, boot order configurations, and automatic cleanup and restart via RakSetvariable.efi, efficient batch modification of BIOS / UEFI configurations is achieved, eliminating the need for manual entry into the BIOS interface item by item, significantly improving testing efficiency. Through scripted calls, multiple variables with different GUIDs and offsets can be processed simultaneously, with unified logging for easy tracking and troubleshooting. Automatic deletion of temporary files, delay, and restart mechanisms ensure a clean environment and immediate configuration effectiveness. The overall solution reduces the risk of human error, supports large-scale configuration regression testing, and enhances the reliability and repeatability of automated testing.

[0053] In some embodiments of the present invention, step S600 of the test method for automatically traversing BIOS configuration options, controlling the tested machine to restart and enter the UEFI Shell environment, includes but is not limited to steps S610 to S620. Specifically, S610: Sends a forced UEFI boot command to the device under test via the BMC IPMI interface; S620: Controls the restart of the device under test based on the forced UEFI boot command, enabling the device under test to enter the UEFI Shell environment; wherein, the UEFI Shell environment automatically detects and executes the automated boot script under the UEFI system partition path when it starts.

[0054] In this embodiment of the invention, a forced UEFI boot command is sent through the BMC IPMI interface, utilizing an out-of-band management channel independent of the operating system and main CPU of the device under test (DUT) to directly control the boot path of the DUT. Even if the DUT's operating system crashes, hangs, or the boot process is abnormal due to prior configuration modifications, it can still be forcibly booted into the UEFI Shell environment. This overcomes the limitations of relying on normal operating system response or traditional boot settings to enter the UEFI Shell, ensuring the test system's absolute controllability over the DUT's boot environment.

[0055] Based on this command, the device under test is restarted and enters the UEFI Shell environment, realizing an automated and deterministic switch from the operating system state to the UEFI Shell environment. The UEFI Shell environment automatically detects and executes the startup.nsh script in a preset path upon startup, embedding the configuration modification task triggering mechanism into the firmware boot process itself. This eliminates the need for manual command input or intervention in the execution timing within the UEFI Shell interface, removing the obstacle of not being able to operate the UEFI Shell interface in real-time in remote scenarios. It achieves unattended automatic execution of configuration modification tasks, providing a reliable automated foundation for large-scale, high-frequency BIOS configuration traversal testing.

[0056] Reference Figure 2As shown, Figure 2 This is a detailed flowchart of step S600 in the automated BIOS configuration option traversal test method provided in this embodiment of the invention. In step S600, the target BIOS configuration options are modified one by one to the corresponding target configuration values ​​by modifying UEFI variables, including but not limited to steps S630 to S660. Specifically, S630: Receives a field containing variable name, GUID, offset address, data type, and target configuration value; S640: After the device under test boots into the UEFI Shell environment, it automatically loads and executes the startup.nsh command sequence; S650: In the UEFI variable storage space, the startup.nsh command sequence of the automated startup script calls the RakSetvariable.efi command sequence of the variable setting tool to locate the BIOS configuration data area corresponding to the variable name, GUID, offset address, and data type, and modifies the BIOS configuration options item by item to write the target configuration value to the specified offset position. S660: Record the results of each of the above operations to a log file.

[0057] In this embodiment of the invention, by receiving multi-dimensional fields such as variable name, GUID, offset address, data type, and target configuration value, precise addressing of the target configuration area in the UEFI variable storage space is achieved. This avoids positioning errors that may occur if only option names are relied upon, ensuring that every BIOS configuration modification is applied to the correct physical location at the firmware level. After the device under test enters the UEFI Shell, it automatically loads and executes the startup.nsh command sequence, completely embedding the triggering and execution of the configuration modification task into the firmware boot process. This eliminates the need for remote manual input of commands or real-time intervention in the UEFI Shell interface, achieving unattended automated operation of the configuration modification process.

[0058] By directly locating and writing target configuration values ​​in the UEFI variable storage space using the RakSetvariable.efi command sequence, the abstraction layer of the BIOS Setup graphical interface is bypassed, and precise writing is performed at the firmware level according to the specified offset address and data type. This fine-grained operation based on GUID and offset address ensures the correct parsing and storage of complex data structures (such as bit fields and enumeration values), avoiding format conversion errors or out-of-bounds writing risks that may be introduced by manual interface operations. At the same time, the method of modifying one by one decomposes the batch configuration task into independent and controllable atomic operations, which facilitates single-step verification and anomaly isolation.

[0059] By recording the results of each operation to a log file, a complete operation auditing and traceability mechanism has been established. Testers can remotely view the logs to confirm the modification status of each configuration item and locate the specific step in the write failure. This provides detailed data support for the judgment of test results, troubleshooting, and subsequent regression analysis, significantly improving the observability of the testing process and the efficiency of problem localization.

[0060] In one embodiment of the present invention: Parsing the IntelRCSetup.i file: Read the IntelRCSetup.i template file and parse the BIOS configuration options (such as IntelSetup, MeRcConfiguration, etc.).

[0061] Extract the GUID, offset, default value, and other information for each BIOS configuration option.

[0062] Extract target configuration options: Based on the testing requirements, filter the target BIOS configuration options that need to be modified (e.g., modify only IntelSetup and SocketProcessorCoreConfig).

[0063] Record the target configuration value corresponding to each target BIOS configuration option (e.g., change the value of offset 148 in IntelSetup to 01).

[0064] Generate modification instruction script: Based on the parsing results, a command script for calling RakSetvariable.efi (containing modification instructions for all target BIOS configuration options) is generated.

[0065] Generate a startup.nsh script containing the command sequence to automatically execute RakSetvariable.efi.

[0066] Generate startup.nsh and RakSetvariable.efi files: Save the generated script as a startup.nsh file.

[0067] Ensure that the RakSetvariable.efi file is compatible with the script (version matching).

[0068] Reference Figure 3 As shown, Figure 3This is a detailed flowchart of step S700 in the automated BIOS configuration option traversal test method provided in this embodiment of the invention. Step S700 verifies whether the target BIOS configuration option is effective, including but not limited to steps S710 to S730. Specifically, S710: Remotely logs into the operating system of the machine under test via SSH and sends a BIOS configuration read command; S720: Responds to BIOS configuration read commands to obtain the current BIOS configuration value of the device under test; S730: Compare the current BIOS configuration value of the tested machine with the target configuration value; if they match, the BIOS configuration modification is considered successful; if they do not match, the BIOS configuration modification is considered unsuccessful.

[0069] In this embodiment of the invention, the remote automated execution of configuration effectiveness verification is achieved by remotely logging into the operating system of the machine under test via SSH and sending a BIOS configuration read command. This eliminates the need for testers to view the BIOS Setup interface on-site or enter the computer room to operate, thus overcoming the limitations of physical space on the verification process.

[0070] The system responds to read commands to obtain the current BIOS configuration value and compares it with the target configuration value, thus constructing a closed-loop verification mechanism of "write-read-compare". This mechanism directly reads the actual effective value at the firmware level in the operating system environment, verifying whether the UEFI variable modification is truly recognized and persistently stored by the BIOS firmware, rather than just confirming the successful execution of the command. By comparing the consistency between the target value and the actual value, the system achieves an objective quantitative judgment of the configuration effectiveness, avoids the subjective error of manual visual inspection, and ensures that every configuration modification undergoes strict validity verification.

[0071] If the comparison is inconsistent, the modification is deemed to have failed, providing a clear anomaly feedback node for the testing process. The testing system can automatically trigger retries, alarms, or log entries based on the judgment result, enabling timely identification and classification of test anomalies, significantly improving the reliability of test results and the efficiency of problem tracing.

[0072] Overall, the aforementioned technical methods transform the traditional verification method, which relies on manual access to the BIOS interface for item-by-item confirmation, into an intelligent closed-loop verification process that can be remotely scheduled, automatically executed, and whose results are quantifiable. This significantly improves the overall efficiency of traversal testing while ensuring the accuracy of verification.

[0073] Reference Figure 4 As shown, Figure 4 This is a detailed flowchart of a testing method for automatically traversing BIOS configuration options provided in an embodiment of the present invention. The testing method for automatically traversing BIOS configuration options also includes, but is not limited to, steps S800 to S820. Specifically, S800: When the BIOS configuration modification is determined to be successful, it responds with a cleanup command to clean up the test environment and generates a test report; S810: When it is determined that the BIOS configuration modification has failed, the exception information is recorded and the target BIOS configuration option is retried. S820: During the target BIOS configuration option retry phase, the BIOS configuration value is recorded each time. If the number of retries for BIOS configuration modification reaches a preset value and there is still no BIOS configuration value that matches the target configuration value, the test is terminated.

[0074] In this embodiment of the invention, when the modification is deemed successful, a cleanup command is executed to clean up the test environment and generate a test report, thereby achieving automatic release of test resources and immediate archiving of test results. The cleanup operation avoids the accumulation of residual variable setting tools and temporary files on the machine under test, preventing cross-contamination of the environment during multiple test iterations; the automatic generation of the test report integrates scattered test data into a structured and traceable document, facilitating the summary analysis and quality assessment of batch test results.

[0075] When a modification fails, the system records the anomaly information and initiates a retry phase, thus establishing a self-healing mechanism for test anomalies. The recording of anomaly information provides detailed on-site data for fault location; the automatic retry mechanism effectively distinguishes between intermittent faults (such as timing conflicts and instantaneous power fluctuations) and deterministic defects, avoiding test process interruptions caused by a single anomaly and improving the fault tolerance and result stability of the test process.

[0076] The retry process records each configuration value and terminates the test if it fails after reaching a preset number of retries, thus achieving controllability of the retry strategy and deadlock prevention. The sequential recording forms a complete audit chain for the retry process, facilitating the analysis of failure modes. The preset termination condition prevents the exhaustion of test resources and wasted time due to infinite retries in abnormal scenarios, ensuring both the sufficiency of the test and the convergence and controllability of the overall test process.

[0077] Overall, the above technical solution incorporates the post-test processing stage into fully automated management through a branching processing mechanism of successful cleanup and archiving, failure record retry, and over-limit termination protection. This achieves a complete closed loop in the test lifecycle and significantly improves the robustness, traceability, and resource utilization efficiency of the automated testing system.

[0078] In one embodiment of the present invention, during the target BIOS configuration option retry phase: Automatically execute startup.nsh UEFI Shell automatically executes scripts: After the machine under test boots into the UEFI Shell, it automatically loads and executes / boot / efi / startup.nsh.

[0079] The automated test script sequentially calls RakSetvariable.efi to modify BIOS configuration options.

[0080] Modify BIOS configuration options: Modify the BIOS configuration item by item according to the instructions in startup.nsh (such as setting IntelSetup, SocketProcessorCoreConfig, etc.).

[0081] Record the results of each operation to a log file (such as setvar.log).

[0082] Reference Figure 5 As shown, Figure 5 This is a detailed flowchart of step S500 in the test method for automatically traversing BIOS configuration options provided in this embodiment of the invention. In step S500, the executable file is uploaded to the UEFI system partition path of the machine under test via a remote connection, including but not limited to steps S510 to S540. Specifically, S510: Use SFTP or SCP tools to upload the startup.nsh command sequence and the RakSetvariable.efi command sequence to the / boot / efi directory of the machine under test; S520: Execute the scp command to copy the executable file from the server to the specified directory of the UEFI system partition path of the device under test; S530: Performs md5sum or sha256sum on the machine under test to verify the integrity of the executable file; S540: Compare the hash values ​​of the executable file on the server side and the executable file on the tested machine to ensure that the executable files of the two are consistent.

[0083] In this embodiment of the invention, the executable file is uploaded to the / boot / efi directory of the machine under test using SFTP or SCP tools. This enables the remote and precise delivery of the executable file to the UEFI system partition, ensuring that the startup.nsh script can be automatically detected and loaded when the UEFI Shell starts up, providing a reliable file foundation for subsequent automated configuration modifications.

[0084] Use the scp command (example command: scp startup.nsh root@)<OS_IP> The ` / boot / efi / ` directive enables remote file copying via an encrypted SSH channel, ensuring security and reliability during file transfer and avoiding data leaks or man-in-the-middle attacks associated with plaintext transmission. Performing `md5sum` or `sha256sum` verification on the tested machine can promptly detect file corruption caused by network jitter, packet loss, or storage errors, preventing UEFIShell execution anomalies or configuration modification failures due to incomplete executable files.

[0085] By comparing the hash values ​​of the server and the tested machine, a dual confirmation of bit-level consistency of the executable file is achieved, eliminating test deviations caused by version inconsistencies or transmission errors, and significantly improving the accuracy of remote deployment and the reliability of test results.

[0086] Overall, the aforementioned technical measures construct a full-link file deployment mechanism of "secure transmission - accurate delivery - integrity verification - consistency confirmation", ensuring that the executable files in the UEFI Shell environment are complete, correct and usable, providing a solid file guarantee for the stable execution of automated traversal tests.

[0087] In some embodiments of the present invention, configuring the remote management parameters of the device under test includes: setting the BMC IP address, BMC account password, OS IP address and OS account password of the device under test in the automated test script; or, inputting and saving the remote management parameters through a graphical user interface (GUI).

[0088] The specific settings for configuring the remote management parameters of the device under test are performed on the server machine and configured in the automation script. The code template is as follows: import paramiko import time # Configuration parameters (usually read from configuration files or environment variables) BMC_IP = "192.168.1.100" # Test machine BMC address OS_IP = "192.168.1.101" # Test machine OS address BMC_CRED = ("admin", "password") # BMC account password OS_CRED = ("root", "rootpassword") # OS account password def ssh_connect(ip, user, pwd, timeout=10): """Establish an SSH connection and verify""" client = paramiko.SSHClient() client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) try: client.connect(ip, username=user, password=pwd, timeout=timeout) print(f"[SSH] Connected to {ip}") return client except Exception as e: print(f"[ERROR] SSH connection failed {ip}: {str(e)}") return None # BMC Configuration Example (Actual BMC management may use IPMI commands) def configure_bmc(ssh_client): """Execute BMC configuration commands via SSH""" if not ssh_client: return commands = [ "ipmitool raw 0x30 0x70 0x01 0x00", # Example: Set BMC network mode "ipmitool lan set 1 ipaddr 192.168.1.100" # Set BMC IP ] for cmd in commands: stdin, stdout, stderr = ssh_client.exec_command(cmd) print(f"[CMD] {cmd} -> {stdout.read().decode()}") # OS Configuration Example def configure_os(ssh_client): """Execute OS configuration via SSH""" # Upload test files to OS sftp = ssh_client.open_sftp() sftp.put("startup.nsh", " / tmp / startup.nsh") # Upload the UEFI startup script sftp.put("RakSetvariable.efi", " / tmp / RakSetvariable.efi") # Upload configuration tool # Execute OS-level configuration commands commands = [ chmod +x / tmp / startup.nsh "sudo / tmp / RakSetvariable.efi Set BIOS_Feature 'Enable' 0", # Modify BIOS options "sudo reboot" # Reboot into BIOS and perform configuration ] for cmd in commands: ssh_client.exec_command(cmd) # Main Process def main(): # 1. Connect to BMC (in real-world scenarios, the IPMI dedicated interface may be used) bmc_ssh = ssh_connect(BMC_IP, *BMC_CRED) configure_bmc(bmc_ssh) # 2. Connecting to the OS os_ssh = ssh_connect(OS_IP, *OS_CRED) configure_os(os_ssh) # 3. Close the connection if bmc_ssh: bmc_ssh.close() if os_ssh: os_ssh.close() if __name__ == "__main__": main() In some embodiments of the present invention, the specific settings for configuring the remote management parameters of the device under test are performed on the server machine. The configuration process in the automated script is presented as a GUI, and a screenshot of the settings window is shown below. Figure 6 and Figure 7 As shown.

[0089] In one embodiment of the present invention, after the test begins, the system first checks whether the test machine is under an operating system via the OS SSH interface. If it is not under an operating system, the test machine is restarted using the BMC command to ensure that the machine under test is under an operating system. Then, the executable files startup.nsh and RakSetvariable.efi are generated and uploaded to the / boot / efi path of the machine under test. The startup.nsh file can be executed directly in the UEFI shell environment. Its contents mainly record the process of modifying BIOS configuration options. After the machine under test restarts and enters the UEFI shell environment, it will automatically execute the startup.nsh file to modify the BIOS configuration.

[0090] This invention also provides a test system for automatically traversing BIOS configuration options, used to implement the test method for automatically traversing BIOS configuration options as described in the above embodiments, comprising: A server machine is used to deploy automated test scripts to generate executable files, control the status of the machine under test, upload executable files, and verify configurations. A machine under test communicates with the server via the BMC and OS SSH interfaces, supporting UEFI Shell environment and BIOS configuration modification; The server interacts with the machine under test via SSH and IPMI protocols to complete an automated traversal test of BIOS configuration options.

[0091] Understandably, by centrally deploying core functions such as executable file generation, test machine status control, remote file upload, and configuration validity verification on the server, centralized management and unified scheduling of the entire BIOS traversal test process are achieved. Testers only need to operate from a single point on the server to complete the entire test chain, avoiding the coordination complexity and version inconsistency issues caused by multi-node distributed operations. At the same time, the server, as an independent control hub, is physically isolated from the test execution environment of the test machine, ensuring the stability and security of the control logic and facilitating the batch deployment, reuse, and maintenance of test strategies.

[0092] The device under test (DUT) provides both a BMC out-of-band interface and an OS SSH in-band interface, constructing a comprehensive communication channel covering all operating states of the DUT. The OS SSH interface enables efficient data transmission and command interaction in operating system mode; the BMC interface provides reliable out-of-band management capabilities when the operating system is unavailable or low-level power / startup control is required. This complementary dual-interface design ensures that the server maintains effective communication connectivity and control capabilities regardless of whether the DUT is in operating system running mode, UEFI Shell environment, or abnormally hung state, providing a solid hardware communication foundation for cross-state automated testing processes.

[0093] The server uses the SSH protocol for in-band encrypted communication and the IPMI protocol for out-of-band hardware-level control, forming a protocol-level collaborative mechanism for in-band data interaction and out-of-band forced control. The SSH protocol ensures the security and data integrity of file transfers and command execution within the operating system state; the IPMI protocol grants the server low-level control capabilities independent of the hardware and software state of the device under test (e.g., forced restart, boot path specification). This division of labor between the two protocols enables the server to perform precise state awareness and forced intervention on the device under test at any time, fully incorporating traditionally manual on-site operations such as multi-state switching and anomaly recovery into remote automated management, significantly improving the environmental adaptability, control reliability, and unattended operation capabilities of the test system.

[0094] It should be understood that the method steps in the embodiments of the present invention can be implemented or carried out by computer hardware, a combination of hardware and software, or by computer instructions stored in a non-transitory computer-readable storage medium. The method can use standard programming techniques. Each program can be implemented in a high-level procedural or object-oriented programming language to communicate with the computer system. However, if necessary, the program can be implemented in assembly or machine language. In any case, the language can be a compiled or interpreted language. Furthermore, for this purpose, the program can run on a programmed application-specific integrated circuit (ASIC).

[0095] Furthermore, the procedures described herein may be performed in any suitable order unless otherwise indicated herein or otherwise clearly contradicted by the context. The procedures described herein (or variations and / or combinations thereof) may be executed under the control of one or more computer systems configured with executable instructions, and may be implemented by hardware or a combination thereof as code (e.g., executable instructions, one or more computer programs, or one or more applications) that commonly executes on one or more processors. The computer program comprises a plurality of instructions executable by one or more processors.

[0096] Furthermore, the method can be implemented in any suitable type of computing platform, including but not limited to personal computers, minicomputers, mainframes, workstations, networked or distributed computing environments, standalone or integrated computer platforms, or in communication with charged particle tools or other imaging devices, etc. Aspects of the invention can be implemented as machine-readable code stored on a non-transitory storage medium or device, whether removable or integrated into a computing platform, such as a hard disk, optical read and / or write storage medium, RAM, ROM, etc., such that it is readable by a programmable computer, and when the storage medium or device is read by the computer, it can be used to configure and operate the computer to perform the processes described herein. Furthermore, the machine-readable code, or portions thereof, can be transmitted via wired or wireless networks. The invention described herein includes these and other different types of non-transitory computer-readable storage media when such media comprises instructions or programs that implement the steps described above in conjunction with a microprocessor or other data processor. When programmed according to the methods and techniques described in the invention, the invention may also include the computer itself.

[0097] A computer program can be applied to input data to perform the functions described herein, thereby transforming the input data to generate output data stored in non-volatile memory. The output information can also be applied to one or more output devices, such as a display. In a preferred embodiment of the invention, the transformed data represents physical and tangible objects, including specific visual depictions of physical and tangible objects generated on the display.

[0098] The above description is merely a preferred embodiment of the present invention. The present invention is not limited to the above-described embodiments. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention, as long as they achieve the technical effects of the present invention by the same means, should be included within the scope of protection of the present invention. Within the scope of protection of the present invention, the technical solutions and / or implementation methods can have various modifications and variations.

Claims

1. A test method for automatically traversing BIOS configuration options, characterized in that, include: Set up automated test scripts on the server side, and configure the remote management parameters of the machine under test through the automated test scripts; Import the configuration option description file corresponding to the BIOS version of the machine under test, parse the configuration option description file, and filter the target BIOS configuration options that need to be modified and the target configuration values ​​corresponding to each target BIOS configuration option according to the test requirements; Based on each target BIOS configuration option and its target configuration value, a corresponding executable file is generated in the UEFI Shell environment. The executable file includes an automated startup script and a variable setting tool. The state of the machine under test is controlled to the operating system state via the SSH interface; The executable file is uploaded to the UEFI system partition path of the machine under test via remote connection; The system controls the machine under test to restart and enter the UEFI Shell environment. The automated startup script is then executed automatically in the UEFI Shell environment. The automated startup script calls the variable setting tool to modify the target BIOS configuration options one by one to the corresponding target configuration values ​​by modifying UEFI variables. Control the tested machine to restart and enter the operating system to verify whether the target BIOS configuration options are effective; The step of generating the corresponding executable file in the UEFI Shell environment based on each target BIOS configuration option and its target configuration value includes: Extract the corresponding variable name, GUID, offset address, data type, and target configuration value from the configuration option description file based on the current target BIOS configuration options; Based on the GUID, the offset address, the data type, and the target configuration value, a corresponding executable file in the UEFI Shell environment is generated. The executable file in the UEFI Shell environment contains a sequence of commands that sequentially call the variable setting tool RakSetvariable.efi and an automated startup script startup.nsh. Each RakSetvariable.efi command sequence is used to set a UEFI variable. Each command in the RakSetvariable.efi command sequence specifies a variable name, GUID, offset address, data type, and target configuration value. The startup.nsh command sequence includes a command to set the BootOrder variable, a cleanup command to delete the variable setting tool after the configuration is modified, a prompt command to output completion information, and a restart command to restart the system to make the configuration take effect. The step of modifying the target BIOS configuration options one by one to the corresponding target configuration values ​​by modifying UEFI variables includes: It receives fields containing variable name, GUID, offset address, data type, and target configuration value; After the machine under test boots into the UEFI Shell environment, it automatically loads and executes the startup.nsh command sequence; In the UEFI variable storage space, the startup.nsh command sequence of the automated startup script calls the RakSetvariable.efi command sequence of the variable setting tool to locate the BIOS configuration data area corresponding to the variable name, the GUID, the offset address, and the data type, and modifies the BIOS configuration options item by item to write the target configuration value to the specified offset position; Record the results of each of the above operations to a log file.

2. The test method for automatically traversing BIOS configuration options according to claim 1, characterized in that, The step of controlling the state of the tested machine to the operating system state via the SSH interface includes: Check whether the machine under test is in an operating system state via the OS SSH interface; If the device under test is not in an operating system state, remotely restart the device under test using the BMC IPMI command until the device under test enters the operating system state.

3. The test method for automatically traversing BIOS configuration options according to claim 1, characterized in that, The configuration option description file is an IntelRCSetup.i format file, which includes the GUID corresponding to each BIOS configuration option.

4. The test method for automatically traversing BIOS configuration options according to claim 1, characterized in that, The process of controlling the device under test to restart and enter the UEFI Shell environment includes: Send a forced UEFI boot command to the device under test via the BMC IPMI interface; The forced UEFI boot command controls the device under test to restart, enabling the device under test to enter the UEFI Shell environment; wherein, the UEFI Shell environment automatically detects and executes the automated boot script under the UEFI system partition path during startup.

5. The test method for automatically traversing BIOS configuration options according to claim 1, characterized in that, The verification of whether the target BIOS configuration options are effective includes: Remotely log in to the operating system of the machine under test via SSH and send a BIOS configuration read command; In response to the BIOS configuration read command, the current BIOS configuration value of the machine under test is obtained; The current BIOS configuration value of the tested machine is compared with the target configuration value; if they match, the BIOS configuration modification is considered successful; if they do not match, the BIOS configuration modification is considered unsuccessful.

6. The test method for automatically traversing BIOS configuration options according to claim 5, characterized in that, Also includes: Once the BIOS configuration modification is determined to be successful, the test environment is cleaned up in response to the cleanup command, and a test report is generated. If the BIOS configuration modification fails, record the error information and proceed to the retry phase of the target BIOS configuration options. In the target BIOS configuration option retry phase, the BIOS configuration value is recorded each time. If the number of retries for BIOS configuration modification reaches a preset value and there is still no BIOS configuration value that matches the target configuration value, the test is terminated.

7. The test method for automatically traversing BIOS configuration options according to claim 1, characterized in that, The step of uploading the executable file to the UEFI system partition path of the machine under test via remote connection includes: Use SFTP or SCP tools to upload the startup.nsh command sequence and the RakSetvariable.efi command sequence to the / boot / efi directory of the machine under test; The scp command is executed to copy the executable file from the server to the specified directory of the UEFI system partition path of the machine under test; On the machine under test, execute md5sum or sha256sum to verify the integrity of the executable file; Compare the hash values ​​of the executable file on the server and the executable file on the tested machine to ensure that the executable files of the two are consistent.

8. A test system for automatically traversing BIOS configuration options, used to implement the method as described in any one of claims 1 to 7, characterized in that, include: A server machine is used to deploy automated test scripts to generate executable files, control the status of the machine under test, upload executable files, and verify configurations. A machine under test communicates with the server via the BMC and OS SSH interfaces, supporting UEFI Shell environment and BIOS configuration modification; The server interacts with the machine under test via SSH and IPMI protocols to complete the automated traversal test of BIOS configuration options.

Citation Information

Patent Citations

  • BIOS option function test method and system based on an AMI BIOS

    CN109669863A

  • Method, device and equipment for initializing BIOS options and storage medium

    CN110928734A

  • BIOS option fault recovery method and device, equipment and storage medium

    CN115129517A