RAID card test method and system based on UEFI management interface, terminal and medium

By remotely logging into the server BMC and simulating keyboard and mouse operations combined with text recognition technology, the problems of low efficiency and high cost of traditional RAID card testing are solved, and automated testing of RAID cards on the UEFI management interface is realized, improving testing efficiency and reducing costs.

CN118626322APending Publication Date: 2024-09-10SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411007649.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-25
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

Traditional UEFI-based RAID card testing requires manual operations, resulting in high testing costs and low efficiency. It is impossible to run automated scripts on the server for automated testing.

Method used

Log in to the WEB management platform of the server BMC remotely, use simulators and screenshot tools to simulate keyboard and mouse operations, and combine text recognition technology to execute test cases on the UEFI management interface to achieve automated testing.

Benefits of technology

It reduces the cost and labor investment of RAID card testing, improves testing efficiency, and realizes automated testing of RAID cards under the UEFI management interface.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118626322A
    Figure CN118626322A
Patent Text Reader

Abstract

The invention relates to the field of RAID card testing, and particularly discloses an RAID card testing method and system based on a UEFI management interface, a terminal and a medium, and the method comprises the following steps: remotely logging in a WEB management platform of a server BMC and entering a server remote management interface; entering a UEFI operation interface of the RAID card; and executing the test case, executing a target operation on the UEFI operation interface of the RAID card by simulating a keyboard and a mouse according to requirements of the test case, intercepting the UEFI operation interface containing a target operation result, and extracting and identifying characters of the UEFI operation interface to obtain a test result. According to the method, the test script is executed locally, the RAID card is automatically tested through screenshot and character recognition, the test efficiency is improved, and the test cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of RAID card testing, and in particular to a RAID card testing method, system, terminal and medium based on UEFI management interface. Background Art

[0002] RAID card, that is, redundant array of independent disk card, disperses the data storage so that even if a hard disk has a problem, the data can be recovered from other hard disks, greatly reducing the risk of data loss.

[0003] The RAID card is responsible for data management to ensure data security. At the same time, ensuring the performance of the RAID card itself is normal can more effectively ensure data security. Therefore, testing the RAID card is also crucial. At present, mainstream RAID cards are tested using three platforms: UEFI, Web, and command line. Both Web and command line are performed after the operating system is loaded. Automated testing can be performed through automated tools to reduce manpower investment. UEFI operation of the RAID card needs to be performed after UEFI is loaded. At this time, the operating system has not yet been loaded, and related scripts cannot be run on the server for automated testing. Traditional UEFI-based testing of RAID cards requires turning on the server power at the server end, entering UEFI, finding the UEFI entrance of RAID on the device to enter the RAID card UEFI operation interface to perform related operations, and then view the test results. This process usually requires a large amount of manpower, increases testing costs, and has low testing efficiency. Summary of the invention

[0004] To solve the above problems, the present invention provides a RAID card testing method, system, terminal and medium based on UEFI management interface, which executes test scripts locally, automatically tests the RAID card through screenshots and text recognition, improves test efficiency and reduces test costs.

[0005] In a first aspect, the technical solution of the present invention provides a RAID card testing method based on the UEFI management interface, including executing a RAID card testing script on a local terminal to implement a test on the RAID card, specifically comprising the following steps: Remotely log in to the server BMC's WEB management platform and enter the server remote management interface; Enter the RAID card UEFI operation interface; Execute the test case, perform the target operation on the RAID card UEFI operation interface by simulating the keyboard and mouse according to the test case requirements, intercept the UEFI operation interface containing the target operation result, and extract and recognize the characters of the UEFI operation interface to obtain the test result.

[0006] In an optional implementation, remotely logging into the web management platform of the server BMC and entering the server remote management interface specifically includes: Use the simulator to log in to the browser; Enter the server BMC's IP address, user name, and password through the simulator's input operation interface and log in to the server BMC's web management platform. Enter the server remote management interface through the remote management tab on the server BMC web management platform.

[0007] In an optional implementation, entering the UEFI operation interface of the RAID card specifically includes: Use the screenshot tool to take a screenshot of the server remote management interface; Perform image analysis on the screenshots; Determine the current status of the server based on the image analysis results; If the server is not powered on, power it on through the power option provided by the remote management service of the server BMC; If the server is powered on and is not in the RAID card UEFI operation interface, restart the server through the BMC; If the server is powered on and in the RAID card UEFI operation interface, no processing is performed; When starting or restarting the server, use the screenshot tool to cyclically capture the server startup interface displayed on the WEB management platform; Use a text recognition tool to identify the text in the captured server startup interface image; When it is recognized that the target key needs to be pressed to enter the UEFI interface, the target key input is simulated through the input simulation tool to control the server to enter the UEFI interface; Use the input simulation tool to simulate keyboard and mouse operations to enter the RAID card UEFI operation interface from the UEFI interface.

[0008] In an optional implementation, simulating keyboard and mouse operations through an input simulation tool to enter the RAID card UEFI operation interface from the UEFI interface specifically includes: Use the screenshot tool to capture the UEFI interface image; Convert UEFI interface images to HSV color space; Use the HSV threshold to locate the white string and other color strings, where the white string is the current cursor position; Use text recognition tools to identify the content of each string and locate the RAID card management entry; Determine keyboard and mouse operation parameters based on the current cursor position and the RAID card management entry position; Based on the determined keyboard and mouse operation parameters, the keyboard and mouse operation are simulated by the input simulation tool to enter the RAID card UEFI operation interface.

[0009] In an optional implementation, the test case includes a functional flow test case, executing the functional flow test case, performing a target operation on the RAID card UEFI operation interface by simulating a keyboard and mouse according to the functional flow test case requirements, intercepting the UEFI operation interface containing the target operation result, and extracting and recognizing the characters of the UEFI operation interface to obtain the test result, specifically including: Use the screenshot tool to capture the current RAID card UEFI operation interface image; Convert the current RAID card UEFI operation interface image to HSV color space; Use the HSV threshold to locate the white string and other color strings, where the white string is the current cursor position; Identify the content of each string using a text recognition tool; Determine whether the current interface is a result interface based on the extracted string content; If yes, determine and record the execution result of the current functional process test case based on the recognized execution result string; If not, locate the target string according to the test requirements of the current functional flow test case; Determine keyboard and mouse operation parameters based on the current cursor position and the target string position; Based on the determined keyboard and mouse operation parameters, the next RAID card UEFI operation interface is entered by simulating keyboard and mouse operation through the input simulation tool, and the current RAID card UEFI operation interface image is captured by the screenshot tool.

[0010] In an optional implementation, the test case includes a data check test case, executing the data check test case, performing a target operation on the RAID card UEFI operation interface by simulating a keyboard and mouse according to the data check test case requirements, intercepting the UEFI operation interface containing the target operation result, and extracting and recognizing the characters of the UEFI operation interface to obtain the test result, specifically including: Use the screenshot tool to capture the current RAID card UEFI operation interface image; Convert the current RAID card UEFI operation interface image to HSV color space; Use the HSV threshold to locate the white string and other color strings, where the white string is the current cursor position; Use the text recognition tool to identify the content of each string and locate the enumeration data check entry required for the current data check test case; Determine keyboard and mouse operation parameters based on the current cursor position and the enumeration data check entry position; Based on the determined keyboard and mouse operation parameters, the input simulation tool is used to simulate the keyboard and mouse operation and click the enumeration data check entry to pop up the result pop-up window; Use the screenshot tool to capture the pop-up window image of the result; Use the text recognition tool to identify the content of each string in the result pop-up window image; Determine whether the content of each string meets expectations, and record the judgment result as the execution result of the current data check test case.

[0011] In an optional implementation, capturing a pop-up window image of the result by using a screenshot tool specifically includes: Use the screenshot tool to capture the UEFI operation interface of the RAID card including the result pop-up window; In the current captured image, search for pixels along the coordinate axis. When there are N consecutive pixels on the horizontal axis that are all the target color, use the first pixel of these N pixels as the coordinate to search for pixels on the horizontal and vertical axes until there are M consecutive pixels that are non-target color pixels. The area with consecutive target color pixels is the result pop-up window area. Use a screenshot tool to take a screenshot of the result pop-up window area to obtain a result pop-up window image.

[0012] In a second aspect, the technical solution of the present invention provides a RAID card testing system based on the UEFI management interface, comprising: Remote login module: remotely log in to the WEB management platform of the server BMC and enter the server remote management interface; Operation interface entry module: enter the RAID card UEFI operation interface; Test case execution module: executes the test case, performs the target operation on the RAID card UEFI operation interface by simulating the keyboard and mouse according to the test case requirements, intercepts the UEFI operation interface containing the target operation result, and extracts and recognizes the characters of the UEFI operation interface to obtain the test result.

[0013] In a third aspect, the technical solution of the present invention provides a terminal, including: A memory, used for storing a RAID card test program based on a UEFI management interface; The processor is used to implement the steps of the RAID card testing method based on the UEFI management interface as described in any one of the above items when executing the RAID card testing program based on the UEFI management interface.

[0014] In a fourth aspect, the technical solution of the present invention provides a computer-readable storage medium, on which a RAID card test program based on the UEFI management interface is stored. When the RAID card test program based on the UEFI management interface is executed by a processor, the steps of the RAID card test method based on the UEFI management interface as described in any one of the above items are implemented.

[0015] The present invention provides a RAID card test method, device, terminal and storage medium based on the UEFI management interface, which has the following beneficial effects compared with the prior art: remotely log in to the server BMC through the local RAID card test script, and then remotely operate the server based on the management of the server by the BMC, and automatically execute test cases based on the server remote operation, combined with screenshot processing and text recognition, to realize automatic testing of RAID cards based on the UEFI management interface. The present invention executes the test script locally, automatically realizes the test of the RAID card through screenshots and text recognition, improves the test efficiency, and reduces the test cost. BRIEF DESCRIPTION OF THE DRAWINGS In order to more clearly illustrate the embodiments of the present invention or the technical solutions of the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0016] Figure 1 This is a schematic diagram of the operation interface for creating a volume.

[0017] Figure 2 It is a schematic diagram of the enumeration data interface display.

[0018] Figure 3 This is a schematic diagram showing the UEFI operation results of the RAID card.

[0019] Figure 4 The present invention is a schematic diagram of remote management of a BMC for implementing the test method of the present invention.

[0020] Figure 5 The present invention provides a flow chart of a RAID card testing method based on the UEFI management interface.

[0021] Figure 6 This is a flowchart for entering the server remote management interface.

[0022] Figure 7 This is a flowchart for entering the UEFI operation interface of the RAID card.

[0023] Figure 8 This is a flowchart of the RAID card function process test.

[0024] Fig. 9 This is a flowchart of the RAID card data check test.

[0025] Fig.10 The present invention provides a schematic block diagram of a RAID card test system based on a UEFI management interface.

[0026] Fig.11 It is a schematic diagram of the structure of a terminal provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0027] In order to enable those skilled in the art to better understand the scheme of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0028] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.

[0029] The key terms appearing in the present invention are explained below.

[0030] RAID: Redundant Array of Independent Disks, a redundant array composed of independent disks, which is composed of many independent disks, combined into a disk group with huge capacity, and uses the additive effect of individual disks to provide data to improve the performance of the entire disk system. Using this technology, data is cut into many segments and stored on each hard disk.

[0031] BMC: Baseboard Management Controller is a dedicated subsystem in the server that is responsible for monitoring and managing the server's hardware status, such as temperature and power consumption. It allows administrators to monitor and manage the server through remote management tools independent of the main operating system, CPU, and main memory.

[0032] UEFI: Universal Extensible Firmware Interface, is a personal computer system specification that defines the software interface between the operating system and the system firmware as an alternative to BIOS. The Extensible Firmware Interface is responsible for the power-on self-test (POST), contacting the operating system, and providing an interface between the operating system and the hardware.

[0033] BIOS: Basic Input Output System, is a set of programs fixed on a ROM chip on the computer motherboard. It stores the most important basic input and output programs of the computer, the self-test program after power-on and the system self-starting program. It can read and write specific information of system settings from CMOS. Its main function is to provide the most basic and direct hardware settings and control for the computer.

[0034] To facilitate understanding of the test method of the present invention, firstly, the relevant operation interface and control method after UEFI enters the RAID card management portal are introduced. Figure 1 This is a schematic diagram of the operation interface for creating a volume. The cursor stays on the Select RAIDLevel label. Some data is enumerated type and needs to be selected, such as the Select RAID Level label. After pressing Enter, a small window will pop up to display all supported setting data contents, such as Figure 2 As shown in the figure, the display results will be different in different scenarios. For example, when there are only two disks, only the RAID0 and RAID1 option labels can be displayed. You can test whether the data display meets your expectations. Some data requires keyboard input of numbers or letters, such as the Virtual Drive Name label. After the operation is completed, the configuration is sent, and the returned result is as follows: Figure 3 As shown, you can verify whether the RAID test results are as expected.

[0035] BMC is a dedicated controller for monitoring and managing servers on the WEB side. The server can be remotely managed on a local computer via the WEB. The testing method of the present invention is implemented based on the WEB remote management service of BMC. Figure 4This is a schematic diagram of BMC remote management for implementing the test method of the present invention. The BMC controller is connected to the local computer through a network interface, receives the mouse and keyboard input of the local computer, packages the mouse and keyboard input through the IPMI protocol, converts it into a USB message, and sends the mouse and keyboard input to the USB driver of the server through the USB channel inside the server. The USB driver parses the USB message and sends the input result to the I / O controller. The I / O controller determines the input and executes the input result. After the graphics card image display processing, the server sends the image frame by frame to the VGA management module of the BMC through the PCIe protocol through the IPMI protocol, and finally displays it on the local computer. Therefore, after using the BMC remote management service to enter the UEFI operation interface of the server's RAID card, the local computer can directly display and control the server interface, which is consistent with the near-end display of the server.

[0036] The RAID card testing method based on the UEFI management interface provided in the embodiment of the present invention is based on the principle that the BMC can remotely control and view the server operation interface, runs an automated script on a local computer, remotely logs in to the server through the BMC's WEB management tool, and tests the RAID card under the UEFI management interface.

[0037] Figure 5 The following is a flow chart of a RAID card testing method based on the UEFI management interface provided by an embodiment of the present invention. Figure 5 The execution subject may be a RAID card test system based on the UEFI management interface. The RAID card test method based on the UEFI management interface provided in the embodiment of the present invention is executed by a computer device, and accordingly, the RAID card test system based on the UEFI management interface runs in the computer device. According to different requirements, the order of the steps in the flowchart can be changed, and some can be omitted.

[0038] like Figure 5 As shown, the method includes the following steps.

[0039] S1, remotely log in to the WEB management platform of the server BMC and enter the server remote management interface.

[0040] S2, enter the RAID card UEFI operation interface.

[0041] S3, execute the test case, perform the target operation on the RAID card UEFI operation interface by simulating the keyboard and mouse according to the test case requirements, intercept the UEFI operation interface containing the target operation result, and extract and recognize the characters of the UEFI operation interface to obtain the test result.

[0042] In order to further understand the present invention, specific examples are provided below to further illustrate the present invention in detail.

[0043] (1) Log in to the server and enter the RAID card UEFI portal.

[0044] The first step is to enter the server remote management interface.

[0045] This step is to remotely log in to the server BMC's WEB management platform and enter the server remote management interface. Figure 6 This is a flowchart for entering the server remote management interface, which specifically includes the following steps.

[0046] S101, use the simulator to log in to the browser.

[0047] S102, input the IP address, user name and password of the server BMC through the input operation interface of the simulator, and log in to the WEB management platform of the server BMC.

[0048] S103, entering the server remote management interface through the remote management tab on the WEB management platform of the server BMC.

[0049] In a specific implementation example, a RAID card test script is run on a local PC, a simulator is used to log in to a Google browser, and the BMC IP, user name, and password are input through the input operation provided by the simulator to automatically log in to the BMC's WEB management platform. The simulator clicks on the BMC's remote management tab to enter the server remote management interface.

[0050] The second step is to enter the RAID card UEFI operation interface.

[0051] After entering the server remote management interface, enter the RAID card UEFI operation interface by controlling the server operation. Figure 7 This is a flowchart for entering the UEFI operation interface of the RAID card, which specifically includes the following steps.

[0052] S201, taking a screenshot of the server remote management interface using a screenshot tool.

[0053] S202, performing image analysis on the screenshot image.

[0054] S203: Determine the current state of the server according to the image analysis result.

[0055] S204: If the server is not powered on, power on the server through a power option provided by a remote management service of the server BMC.

[0056] S205: If the server is powered on and is not in the RAID card UEFI operation interface, restart the server through the BMC.

[0057] S206: If the server is powered on and is in the RAID card UEFI operation interface, no processing is performed.

[0058] In a specific embodiment, the pyautogui module of the python third-party library is used as a screenshot tool, and a screenshot is taken to obtain the server remote management interface. The image is analyzed to view the current status of the server and make a judgment. If it is not turned on, the server is turned on through the power option provided by the remote management service of the BMC; if it is turned on but in other interfaces and not in the RAID card UEFI entry interface, the server is restarted through the BMC (the BMC remote management tool supports operations on the server power supply, including power on, power off, restart, etc.); if the RAID card UEFI operation interface has been entered, no related operations are required.

[0059] If the server is not turned on, the server remote management interface will display poweroff. After taking a screenshot of the server remote management interface, you can extract the string content in the image to determine the server status and the interface it is in. You can also pre-train the image recognition network structure in advance to identify image parameters to determine the server status and the interface it is in.

[0060] S207, during the process of starting or restarting the server, cyclically capturing the server startup interface displayed on the WEB management platform through a screenshot tool.

[0061] S208, recognizing the text in the captured server startup interface image by using a text recognition tool.

[0062] S209, when it is recognized that a target key needs to be pressed to enter the UEFI interface, the target key input is simulated by an input simulation tool to control the server to enter the UEFI interface.

[0063] S210, entering the RAID card UEFI operation interface from the UEFI interface by simulating keyboard and mouse operations through an input simulation tool.

[0064] In a specific embodiment, pytesseract is used as a text recognition tool and input simulation tool. After starting or restarting the server, the loading screen of the server startup process will be displayed on the WEB side of the local PC. The image of the server startup interface displayed on the WEB is captured by pyautogui loop, and the text in it is recognized by pytesseract. When it is detected that del needs to be pressed to enter the UEFI field (Press <del>to Setup of <f11>to Boot Menu or <f12>to PXEBoot), pyautogui is used to simulate the del key input, control the server to enter the UEFI interface, capture the image, determine the white string as the cursor position, locate the RAID card management entrance according to the position of other color strings, and enter the RAID card UEFI operation interface.

[0065] This specific embodiment, after entering the UEFI interface, uses an input simulation tool to simulate keyboard and mouse operations to enter the RAID card UEFI operation interface, which specifically includes the following steps.

[0066] S210.1, use the screenshot tool to capture the UEFI interface image.

[0067] S210.2, convert UEFI interface images to HSV color space.

[0068] S210.3, locating the white character string and other color character strings by using the HSV threshold, wherein the white character string is the current cursor position.

[0069] S210.4, using a text recognition tool to identify the content of each character string and locate the RAID card management entry.

[0070] S210.5, determine keyboard and mouse operation parameters according to the current cursor position and the RAID card management entry position.

[0071] S210.6, based on the determined keyboard and mouse operation parameters, simulate keyboard and mouse operation through an input simulation tool to enter the RAID card UEFI operation interface.

[0072] The UEFI interface is captured through the pyautogui module, and the screenshot is converted to the HSV color space. The HSV thresholds corresponding to different colors are different. By checking the HSV thresholds, strings of different colors can be located. The white string is the cursor position, and other color strings (i.e. non-white strings) are not the cursor position. The content of each string is identified, and the string of the RAID card management entrance can be identified by matching the string content with the target content, and the target string position can be located. Then the keyboard and mouse operation parameters are determined according to the current cursor position and the target string position.

[0073] Obtain the coordinates (x, y) of the current cursor on the screen through image analysis technology. Similarly, use image analysis technology to identify the coordinates (x_target, y_target) of the target string position. Calculate the straight-line distance from the current cursor position to the target position using the Pythagorean theorem, and determine the moving direction based on the differences in the x and y coordinates. If x_target > x, move right; if x_target < x, move left; if y_target > y, move down; if y_target < y, move up.

[0074] For the keyboard, the arrow keys usually move one character position or a small distance on the screen each time. Since keyboard movement is not continuous, the straight-line distance needs to be converted into multiple arrow key operations. The exact movement distance of the arrow keys can be determined through a trial-and-error method. According to the direction, send the corresponding arrow key press and release events in sequence until the cursor is close to the target position.

[0075] For the mouse, the movement unit of the mouse is pixels, but the specific number of pixels to move depends on the screen resolution, mouse DPI settings, and the mouse acceleration settings of the operating system. The amount of mouse movement required for the mouse to move a certain distance (such as 100 pixels) on the screen can be determined through experiments (usually the distance the mouse moves on the physical plane or the number of times the mouse wheel scrolls). Calculate the number of pixels that need to be moved based on the difference between the target position and the current position, and convert it into the amount of mouse movement. Send a mouse movement event to move the cursor to the target position.

[0076] This specific embodiment greatly simplifies the monitoring and management process of the remote server through automated screenshotting, image analysis, and decision execution. Compared with the traditional manual inspection and operation, this method can respond more quickly and accurately to the changes in the server status, thereby improving the overall operation and maintenance efficiency. Moreover, the above process performs status judgment and operation execution through automated means, reducing human intervention, lowering the probability of errors, and improving the stability and reliability of the system. The logic of performing different operations according to different server statuses (such as not powered on, powered on but not in a specific interface, etc.) in the process enables the system to flexibly handle various situations, enhancing adaptability and scalability. During the startup or restart process of the server, through loop screenshotting and automatic analysis, the system can independently judge and trigger corresponding operations, such as simulating key input to enter a specific configuration interface, etc., achieving a certain degree of unattended management and reducing the dependence on operation and maintenance personnel.

[0077] (2) Execute test cases to test the RAID card.

[0078] The RAID card test is divided into two parts: functional flow test and data check test. The test cases include functional flow test cases and data check test cases. The two parts of the test are explained below.

[0079] (2.1) Functional flow testing.

[0080] This specific embodiment executes a functional flow test case, performs a target operation on the RAID card UEFI operation interface by simulating a keyboard and mouse according to the functional flow test case requirements, intercepts the UEFI operation interface containing the target operation result, and extracts and recognizes the characters of the UEFI operation interface to obtain a test result. Figure 8 The following is a flow chart of the RAID card function process test, which specifically includes the following steps.

[0081] S301, using a screenshot tool to capture a picture of the current RAID card UEFI operation interface.

[0082] Use the pyautogui module to capture the current RAID card UEFI operation interface image and save the image.

[0083] S302, converting the current RAID card UEFI operation interface image into the HSV color space.

[0084] Use opencv to open the image and use opencv to convert the image color space to HSV.

[0085] S303, locating the white character string and other color character strings by using the HSV threshold, wherein the white character string is the current cursor position.

[0086] S304, identifying the content of each character string by using a text recognition tool.

[0087] The HSV thresholds corresponding to various colors are different. By checking the HSV thresholds, pytesseract is used to extract all strings in sequence, where the white string is the label where the cursor is located, the black string is the label that cannot be selected, and the blue string is the optional label.

[0088] S305: Determine whether the current interface is a result interface based on the extracted character string content.

[0089] The test case contains the string content that should be included in the result interface. The extracted string content is compared with the standard string content to determine whether it is the result interface.

[0090] S306: If yes, determine and record the execution result of the current functional process test case according to the identified execution result character string.

[0091] S307, if not, locate the target string according to the test requirements of the current functional flow test case.

[0092] S308, determining keyboard and mouse operation parameters according to the current cursor position and the target character string position.

[0093] S309, based on the determined keyboard and mouse operation parameters, simulate the keyboard and mouse operation through the input simulation tool to enter the next RAID card UEFI operation interface, and return to step S301.

[0094] The simulation of keyboard and mouse operation is similar to the above step S210 and will not be described in detail here.

[0095] This specific embodiment tests the RAID card function process, takes a screenshot of the WEB display interface and uses pytesseract to identify the string in the picture and determine the cursor position, performs corresponding operations based on the recognition results and determines the operation results. Figure 1 In the example of creating a volume interface, the white font Select RAID Level is the label where the cursor is located on the UEFI interface, and other color fonts are operation labels. According to the cursor position, the script controls the keyboard to select and input the RAID level, volume size, volume name, etc., and finally creates a volume and identifies Figure 3 The result of the operation marks the success or failure of the use case execution.

[0096] (2.2) Data inspection test.

[0097] This specific embodiment executes a data check test case, performs a target operation on the RAID card UEFI operation interface by simulating a keyboard and mouse according to the data check test case requirements, intercepts the UEFI operation interface containing the target operation result, and extracts and recognizes the characters of the UEFI operation interface to obtain a test result. Fig. 9 The flowchart of the RAID card data check test specifically includes the following steps.

[0098] S401, using a screenshot tool to capture a picture of the current RAID card UEFI operation interface.

[0099] S402, converting the current RAID card UEFI operation interface image into the HSV color space.

[0100] Capture a picture of the UEFI management interface of the RAID card, save the picture, open the picture with opencv, and convert the picture color space to HSV.

[0101] S403, locating the white character string and other color character strings by using the HSV threshold, wherein the white character string is the current cursor position.

[0102] S404, using a text recognition tool to identify the content of each character string and locate the enumerated data inspection entry required for the current data inspection test case.

[0103] S405, determining keyboard and mouse operation parameters according to the current cursor position and the enumerated data check entry position.

[0104] S406, based on the determined keyboard and mouse operation parameters, the input simulation tool is used to simulate the keyboard and mouse operation and click the enumeration data check entry to pop up a result pop-up window.

[0105] In the above steps S401-S406, a certain enumeration data is opened according to the test tag to check the parameters, a small window pops up, and the content of the small window is analyzed to detect whether the test passes. This specific embodiment obtains the keyboard and mouse operation parameters by cursor positioning and target entry positioning, and then controls the movement of the keyboard and mouse to perform the corresponding operation to pop up the corresponding pop-up window. By automatically controlling the keyboard and mouse operations, the automation of the test process is realized, thereby significantly improving the speed and efficiency of test execution. At the same time, the cursor positioning and target entry positioning are used to ensure the accuracy of the operation, so that the test can accurately simulate user behavior, thereby more comprehensively covering the test scenarios and improving the accuracy and reliability of the test results.

[0106] S407, using a screenshot tool to capture a pop-up window image of the result.

[0107] S407.1, use a screenshot tool to capture a picture of the UEFI operation interface of the RAID card including the result pop-up window.

[0108] S407.2, search for pixels in the current captured image according to the coordinate axis. When there are N consecutive pixels on the horizontal axis that are all the target color, use the first pixel of the N pixels as the coordinate to search for pixels on the horizontal and vertical axes until there are M consecutive pixels that are non-target color pixels. The area of ​​the consecutive target color pixels is the result pop-up window area, where N and M are integers greater than 2.

[0109] S407.3, taking a screenshot of the result pop-up window area using a screenshot tool to obtain a result pop-up window image.

[0110] For example, in the image, search for pixels according to the coordinate axis. When there are 5 consecutive blue pixels on the horizontal axis, use the first point as the coordinate to search for pixels on the horizontal and vertical axes until there are 3 consecutive non-blue pixels. The area of ​​the consecutive pixels is the area where the pop-up window is located (e.g. Figure 2 In the pop-up window area), use pyautogui to take a screenshot of the local area.

[0111] S408, using a text recognition tool to recognize the content of each character string in the result pop-up window image.

[0112] S409, judging whether the content of each character string meets expectations, and recording the judgment result as the execution result of the current data check test case.

[0113] This specific embodiment supports data check testing for RAID cards. Figure 2 For example, there will be many interference items when recognizing the string of the entire image, so first determine Figure 2 The area where the small window pops up and a screenshot is taken, and then pytesseract is used to identify the string in the picture, determine whether the string displayed in the small window meets the expectations, and mark the success or failure of the use case execution.

[0114] An embodiment of a RAID card testing method based on the UEFI management interface is described in detail above. Based on the RAID card testing method based on the UEFI management interface described in the above embodiment, an embodiment of the present invention also provides a RAID card testing system based on the UEFI management interface corresponding to the method.

[0115] Fig.10 1 is a schematic block diagram of a RAID card test system based on the UEFI management interface provided by an embodiment of the present invention. The RAID card test system based on the UEFI management interface 1000 can be divided into multiple functional modules according to the functions it performs, such as Fig.10 The functional modules may include: a remote login module 1010, an operation interface entry module 1020, and a test case execution module 1030. The module referred to in the present invention refers to a series of computer program segments that can be executed by at least one processor and can complete fixed functions, which are stored in a memory.

[0116] Remote login module 1010: remotely log in to the WEB management platform of the server BMC and enter the server remote management interface.

[0117] Operation interface entry module 1020: Enter the RAID card UEFI operation interface.

[0118] Test case execution module 1030: executes the test case, performs the target operation on the RAID card UEFI operation interface by simulating the keyboard and mouse according to the test case requirements, intercepts the UEFI operation interface containing the target operation result, and extracts and recognizes the characters of the UEFI operation interface to obtain the test result.

[0119] In an optional implementation, the remote login module 1010 specifically performs: using a simulator to log in to a browser; inputting the IP address, user name and password of the server BMC through the input operation interface of the simulator, and logging in to the WEB management platform of the server BMC; entering the server remote management interface through the remote management tab on the WEB management platform of the server BMC.

[0120] In an optional embodiment, the operation interface entry module 1020 specifically executes: performing image analysis on the screenshot; determining the current status of the server based on the image analysis results; if the server is not turned on, turning on the server through the power option provided by the remote management service of the server BMC; if the server is turned on and is not in the RAID card UEFI operation interface, restarting the server through the BMC; if the server is turned on and is in the RAID card UEFI operation interface, no processing is performed; during the process of starting or restarting the server, using a screenshot tool to cyclically capture the server startup interface displayed on the WEB management platform; using a text recognition tool to recognize the text in the captured server startup interface image; when it is recognized that a target button needs to be pressed to enter the UEFI interface, using an input simulation tool to simulate the target button input to control the server to enter the UEFI interface; using an input simulation tool to simulate keyboard and mouse operations to enter the RAID card UEFI operation interface from the UEFI interface.

[0121] In an optional embodiment, keyboard and mouse operations are simulated through an input simulation tool to enter the RAID card UEFI operation interface from the UEFI interface, specifically including: capturing a UEFI interface image through a screenshot tool; converting the UEFI interface image into an HSV color space; locating white strings and other color strings through HSV thresholds, wherein the white string is the current cursor position; identifying the content of each string through a text recognition tool to locate the RAID card management entry; determining keyboard and mouse operation parameters based on the current cursor position and the RAID card management entry position; based on the determined keyboard and mouse operation parameters, simulating keyboard and mouse operations through the input simulation tool to enter the RAID card UEFI operation interface.

[0122] In an optional embodiment, the test case includes a functional flow test case, and the test case execution module 1030 specifically executes: capturing the current RAID card UEFI operation interface image through a screenshot tool; converting the current RAID card UEFI operation interface image into an HSV color space; locating white strings and other color strings through an HSV threshold, wherein the white string is the current cursor position; identifying the content of each string through a text recognition tool; judging whether the current interface is a result interface through the extracted string content; if so, judging and recording the current functional flow test case execution result based on the identified execution result string; if not, locating the target string according to the test requirements of the current functional flow test case; determining the keyboard and mouse operation parameters based on the current cursor position and the target string position; based on the determined keyboard and mouse operation parameters, simulating the keyboard and mouse operation through the input simulation tool to enter the next RAID card UEFI operation interface, and continuing to capture the current RAID card UEFI operation interface image through the screenshot tool.

[0123] In an optional embodiment, the test case includes a data check test case, and the test case execution module 1030 specifically executes: capturing the current RAID card UEFI operation interface image through a screenshot tool; converting the current RAID card UEFI operation interface image into an HSV color space; locating white strings and other color strings through an HSV threshold, wherein the white string is the current cursor position; identifying the content of each string through a text recognition tool to locate the enumeration data check entry required for the current data check test case; determining the keyboard and mouse operation parameters according to the current cursor position and the enumeration data check entry position; based on the determined keyboard and mouse operation parameters, simulating the keyboard and mouse operation through an input simulation tool to click on the enumeration data check entry to pop up a result pop-up window; capturing the result pop-up window image through a screenshot tool; identifying the content of each string in the result pop-up window image through a text recognition tool; judging whether the content of each string meets expectations, and recording the judgment result as the execution result of the current data check test case.

[0124] In an optional embodiment, the result pop-up window image is captured by a screenshot tool, specifically including: capturing the UEFI operation interface image of the RAID card that currently includes the result pop-up window by the screenshot tool; searching for pixels according to the coordinate axis in the current captured image, and when there are N consecutive pixels on the horizontal axis that are all the target color, using the first pixel of these N pixels as the coordinate, searching for pixels on the horizontal and vertical axes until there are M consecutive pixels that are non-target color pixels, and the area with continuous target color pixels is the result pop-up window area; taking a screenshot of the result pop-up window area by the screenshot tool to obtain a result pop-up window image.

[0125] Fig.11 A schematic diagram of the structure of a terminal 1100 provided in an embodiment of the present invention includes: a processor 1110, a memory 1120 and a communication unit 1130. The processor 1110 is used to implement the following steps when implementing a RAID card test program based on a UEFI management interface stored in the memory 1120: Remotely log in to the server BMC's WEB management platform and enter the server remote management interface; Enter the RAID card UEFI operation interface; Execute the test case, perform the target operation on the RAID card UEFI operation interface by simulating the keyboard and mouse according to the test case requirements, intercept the UEFI operation interface containing the target operation result, and extract and recognize the characters of the UEFI operation interface to obtain the test result.

[0126] The terminal 1100 includes a processor 1110, a memory 1120 and a communication unit 1130. These components communicate via one or more buses. Those skilled in the art will appreciate that the server structure shown in the figure does not limit the present invention, and it may be a bus structure or a star structure, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0127] The memory 1120 can be used to store the execution instructions of the processor 1110, and the memory 1120 can be implemented by any type of volatile or non-volatile storage terminal or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. When the execution instructions in the memory 1120 are executed by the processor 1110, the terminal 1100 can execute some or all of the steps in the following method embodiments.

[0128] The processor 1110 is the control center of the storage terminal, and uses various interfaces and lines to connect various parts of the entire electronic terminal. It runs or executes software programs and / or modules stored in the memory 1120, and calls data stored in the memory to perform various functions of the electronic terminal and / or process data. The processor can be composed of an integrated circuit (IC), for example, it can be composed of a single packaged IC, or it can be composed of multiple packaged ICs with the same or different functions. For example, the processor 1110 can include only a central processing unit (CPU). In an embodiment of the present invention, the CPU can be a single computing core or multiple computing cores.

[0129] The communication unit 1130 is used to establish a communication channel so that the storage terminal can communicate with other terminals, receive user data sent by other terminals or send user data to other terminals.

[0130] The present invention also provides a computer storage medium, wherein the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).

[0131] The computer storage medium stores a RAID card test program based on the UEFI management interface, and the RAID card test program based on the UEFI management interface implements the following steps when executed by the processor: Remotely log in to the server BMC's WEB management platform and enter the server remote management interface; Enter the RAID card UEFI operation interface; Execute the test case, perform the target operation on the RAID card UEFI operation interface by simulating the keyboard and mouse according to the test case requirements, intercept the UEFI operation interface containing the target operation result, and extract and recognize the characters of the UEFI operation interface to obtain the test result.

[0132] Those skilled in the art can clearly understand that the technology in the embodiments of the present invention can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the technical solution in the embodiments of the present invention, in essence or in other words, the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, and other media that can store program codes, including several instructions for enabling a computer terminal (which can be a personal computer, a server, or a second terminal, a network terminal, etc.) to execute all or part of the steps of the methods described in each embodiment of the present invention.

[0133] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0134] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0135] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0136] The above disclosure is only a preferred embodiment of the present invention, but the present invention is not limited thereto. Any non-creative changes that can be thought of by a person skilled in the art, as well as several improvements and modifications made without departing from the principle of the present invention, should fall within the protection scope of the present invention. < / del>

Claims

1. A RAID card testing method based on UEFI management interface, characterized in that: The RAID card test script is executed on the local terminal to test the RAID card, which specifically includes the following steps: Remotely log in to the server BMC's WEB management platform and enter the server remote management interface; Enter the RAID card UEFI operation interface; Execute the test case, perform the target operation on the RAID card UEFI operation interface by simulating the keyboard and mouse according to the test case requirements, intercept the UEFI operation interface containing the target operation result, and extract and recognize the characters of the UEFI operation interface to obtain the test result.

2. The RAID card testing method based on UEFI management interface according to claim 1, characterized in that: Remotely log in to the server BMC's web management platform and enter the server remote management interface, including: Use the simulator to log in to the browser; Enter the server BMC's IP address, user name, and password through the simulator's input operation interface and log in to the server BMC's web management platform. Enter the server remote management interface through the remote management tab on the server BMC web management platform.

3. The RAID card testing method based on UEFI management interface according to claim 1 or 2, characterized in that: Enter the RAID card UEFI operation interface, including: Use the screenshot tool to take a screenshot of the server remote management interface; Perform image analysis on the screenshots; Determine the current status of the server based on the image analysis results; If the server is not powered on, power it on through the power option provided by the remote management service of the server BMC; If the server is powered on and is not in the RAID card UEFI operation interface, restart the server through the BMC; If the server is powered on and in the RAID card UEFI operation interface, no processing is performed; When starting or restarting the server, use the screenshot tool to cyclically capture the server startup interface displayed on the WEB management platform; Use a text recognition tool to identify the text in the captured server startup interface image; When it is recognized that the target key needs to be pressed to enter the UEFI interface, the target key input is simulated through the input simulation tool to control the server to enter the UEFI interface; Use the input simulation tool to simulate keyboard and mouse operations to enter the RAID card UEFI operation interface from the UEFI interface.

4. The RAID card testing method based on UEFI management interface according to claim 3 is characterized in that: Use the input simulation tool to simulate keyboard and mouse operations to enter the RAID card UEFI operation interface from the UEFI interface, including: Use the screenshot tool to capture the UEFI interface image; Convert UEFI interface images to HSV color space; Use the HSV threshold to locate the white string and other color strings, where the white string is the current cursor position; Use text recognition tools to identify the content of each string and locate the RAID card management entry; Determine keyboard and mouse operation parameters based on the current cursor position and the RAID card management entry position; Based on the determined keyboard and mouse operation parameters, the keyboard and mouse operation are simulated by the input simulation tool to enter the RAID card UEFI operation interface.

5. The RAID card testing method based on UEFI management interface according to claim 1, characterized in that: The test cases include functional flow test cases. The functional flow test cases are executed. According to the requirements of the functional flow test cases, the target operation is performed on the RAID card UEFI operation interface by simulating the keyboard and mouse, and the UEFI operation interface containing the target operation result is intercepted. The characters of the UEFI operation interface are extracted and recognized to obtain the test results, which specifically include: Use the screenshot tool to capture the current RAID card UEFI operation interface image; Convert the current RAID card UEFI operation interface image to HSV color space; Use the HSV threshold to locate the white string and other color strings, where the white string is the current cursor position; Identify the content of each string using a text recognition tool; Determine whether the current interface is a result interface based on the extracted string content; If yes, determine and record the execution result of the current functional process test case based on the recognized execution result string; If not, locate the target string according to the test requirements of the current functional flow test case; Determine keyboard and mouse operation parameters based on the current cursor position and the target string position; Based on the determined keyboard and mouse operation parameters, the next RAID card UEFI operation interface is entered by simulating keyboard and mouse operation through the input simulation tool, and the current RAID card UEFI operation interface image is captured by the screenshot tool.

6. The RAID card testing method based on UEFI management interface according to claim 1, characterized in that: The test cases include data check test cases, executing data check test cases, performing target operations on the RAID card UEFI operation interface by simulating the keyboard and mouse according to the requirements of the data check test cases, intercepting the UEFI operation interface containing the target operation results, and extracting and recognizing the characters of the UEFI operation interface to obtain the test results, which specifically include: Use the screenshot tool to capture the current RAID card UEFI operation interface image; Convert the current RAID card UEFI operation interface image to HSV color space; Use the HSV threshold to locate the white string and other color strings, where the white string is the current cursor position; Use the text recognition tool to identify the content of each string and locate the enumeration data check entry required for the current data check test case; Determine keyboard and mouse operation parameters based on current cursor position and enumeration data check entry position; Based on the determined keyboard and mouse operation parameters, the input simulation tool is used to simulate the keyboard and mouse operation and click the enumeration data check entry to pop up the result pop-up window; Use the screenshot tool to capture the pop-up window image of the result; Use the text recognition tool to identify the content of each string in the result pop-up window image; Determine whether the content of each string meets expectations, and record the judgment result as the execution result of the current data check test case.

7. The RAID card testing method based on UEFI management interface according to claim 6, characterized in that: Use the screenshot tool to capture the pop-up window image of the result, including: Use the screenshot tool to capture the UEFI operation interface of the RAID card including the result pop-up window; In the current captured image, search for pixels along the coordinate axis. When there are N consecutive pixels on the horizontal axis that are all the target color, use the first pixel of these N pixels as the coordinate to search for pixels on the horizontal and vertical axes until there are M consecutive pixels that are non-target color pixels. The area with consecutive target color pixels is the result pop-up window area. Use a screenshot tool to take a screenshot of the result pop-up window area to obtain a result pop-up window image.

8. A RAID card testing system based on UEFI management interface, characterized in that: include, Remote login module: remotely log in to the WEB management platform of the server BMC and enter the server remote management interface; Operation interface entry module: enter the RAID card UEFI operation interface; Test case execution module: executes the test case, performs the target operation on the RAID card UEFI operation interface by simulating the keyboard and mouse according to the test case requirements, intercepts the UEFI operation interface containing the target operation result, and extracts and recognizes the characters of the UEFI operation interface to obtain the test result.

9. A terminal, characterized in that: include: A memory, used for storing a RAID card test program based on a UEFI management interface; A processor is used to implement the steps of the RAID card testing method based on the UEFI management interface as described in any one of claims 1-7 when executing the RAID card testing program based on the UEFI management interface.

10. A computer-readable storage medium, characterized in that: The readable storage medium stores a RAID card test program based on the UEFI management interface. When the RAID card test program based on the UEFI management interface is executed by the processor, the steps of the RAID card test method based on the UEFI management interface as described in any one of claims 1-7 are implemented.

Citation Information

Cited By

  • Basic input and output system automatic test method, product, equipment and medium

    CN119046075A

  • Test method and device for automatically checking BMC information and storage medium

    CN119847845A

  • BIOS automatic configuration method for large-scale server cluster

    CN121833068A