Movatterモバイル変換


[0]ホーム

URL:


CN119847845A - Test method, device and storage medium for automatically checking BMC information - Google Patents

Test method, device and storage medium for automatically checking BMC information
Download PDF

Info

Publication number
CN119847845A
CN119847845ACN202510322464.2ACN202510322464ACN119847845ACN 119847845 ACN119847845 ACN 119847845ACN 202510322464 ACN202510322464 ACN 202510322464ACN 119847845 ACN119847845 ACN 119847845A
Authority
CN
China
Prior art keywords
bmc
data
page
user
login
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202510322464.2A
Other languages
Chinese (zh)
Inventor
张文豪
廖进达
徐飞扬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Baode Computer System Co ltd
Original Assignee
Baode Computer System Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Baode Computer System Co ltdfiledCriticalBaode Computer System Co ltd
Priority to CN202510322464.2ApriorityCriticalpatent/CN119847845A/en
Publication of CN119847845ApublicationCriticalpatent/CN119847845A/en
Pendinglegal-statusCriticalCurrent

Links

Classifications

Landscapes

Abstract

The application discloses a test method, a device and a storage medium for automatically checking BMC information, which are used for solving the problem that information messy codes on web cannot be prevented in the traditional interface test. The method comprises the steps of logging in a BMC login page by using an automatic tool according to configuration file data to obtain a BMC user page, processing the BMC user page to obtain a user page screenshot, calling TESSERACT-OCR according to preset position data to perform text recognition on the user page screenshot to obtain page data, judging whether the page data meets preset check rules or not, and if yes, executing the next BMC test.

Description

Test method, device and storage medium for automatically checking BMC information
Technical Field
The present application relates to the field of computer testing, and in particular, to a method and apparatus for automatically verifying BMC information, and a storage medium.
Background
In today's digital age, server management systems such as OpenBMC and the like have become key components of data center operation and maintenance. The system provides detailed management information and a convenient operation interface for operation staff through the Web page, so that the operation staff can remotely monitor and control the server hardware. With the acceleration of digital transformation and the continuous expansion of the scale of data centers, the stability and reliability of the server management system are particularly important.
In order to ensure the stability and reliability of OpenBMC pages, the traditional automatic test method is widely adopted. The traditional automatic test method is mainly based on a Web interface for interface and performance test, and whether the response and the function of the Web page meet expectations or not is verified by simulating user operation.
However, with the continuous development of Web technology and the increasing complexity of application environments, conventional automated testing methods gradually expose some problems. When testing is performed, information messy codes on the Web page are difficult to effectively prevent. The problem of messy codes not only affects user experience, but also can cause misreading and misoperation of key information, thereby bringing potential risks to operation and maintenance work of a data center.
Disclosure of Invention
In order to solve the technical problems, the application provides a test method, a device and a storage medium for automatically checking BMC information.
The following describes the technical scheme provided in the present application:
The first aspect of the application provides a test method for automatically checking BMC information, which comprises the following steps:
Logging in the BMC login page by using an automation tool according to the configuration file data so as to acquire a BMC user page;
processing the BMC user page to obtain a user page screenshot;
Invoking TESSERACT-OCR according to preset position data to perform character recognition on the user page screenshot so as to acquire page data;
judging whether the page data accords with a preset check rule or not;
if yes, the next BMC test is executed.
Optionally, the logging in the BMC login page according to the configuration file data using an automation tool to obtain a BMC user page includes:
reading a configuration file to obtain BMC login data and ChromeDriver data;
creating a browser driving instance according to an automation tool, the ChromeDriver data and a target Chrome option;
accessing a login page of the BMC by using the browser driving example;
and inputting the BMC login data into the login page to acquire a BMC user page.
Optionally, before the creating the browser driver instance according to the automation tool, the ChromeDriver data, and the target Chrome option, the method further includes:
Creating a Chrome option;
creating a user data directory using the temporary file library;
and inputting the user data catalog and the starting parameters into the Chrome option to acquire a target Chrome option.
Optionally, the invoking TESSERACT-OCR according to the preset location data performs text recognition on the user page screenshot to obtain page data, including:
acquiring a cutting area according to the user page screenshot and preset position data;
And calling TESSERACT-OCR to perform character recognition on the clipping region so as to acquire page data.
Optionally, the invoking TESSERACT-OCR performs text recognition on the clipping region to obtain page data, including:
Using pytesseract library call TESSERACT-OCR to perform text recognition on the clipping region so as to acquire text content;
and preprocessing the text content to obtain page data.
Optionally, the determining whether the page data meets a preset check rule includes:
Traversing the page data to obtain a field type and a corresponding field value;
Selecting a target check rule from preset check rules according to the field type;
and judging whether the field value corresponding to the field type accords with the target check rule.
Optionally, after the determining whether the page data meets the preset check rule, the method further includes:
if not, recording difference data in the page data;
And submitting the difference data to a manual review and executing the next BMC test.
The second aspect of the present application provides a test apparatus for automatically checking BMC information, the apparatus comprising:
The login unit is used for logging in the BMC login page by using the automation tool according to the configuration file data so as to acquire a BMC user page;
The processing unit is used for processing the BMC user page to obtain a user page screenshot;
the recognition unit is used for calling TESSERACT-OCR according to preset position data to perform character recognition on the user page screenshot so as to acquire page data;
The judging unit is used for judging whether the page data accords with a preset check rule;
And the first execution unit is used for executing the next BMC test when the judgment unit determines that the page data accords with the preset check rule.
A third aspect of the present application provides a test apparatus for automatically checking BMC information, the apparatus comprising:
A processor, a memory, an input-output unit, and a bus;
The processor is connected with the memory, the input/output unit and the bus;
The memory holds a program that the processor invokes to perform the first aspect and any of the optional test methods of automatically checking BMC information of the first aspect.
A fourth aspect of the present application provides a computer readable storage medium having a program stored thereon, which when executed on a computer performs the first aspect and any one of the first aspect may be selected from the test methods of automated verification of BMC information.
From the above technical scheme, the application has the following advantages:
according to the method, the screenshot of the BMC login page is intercepted, and the key information area is cut by combining the preset position data, so that possible information omission or misreading in the traditional testing method is effectively avoided. Then, by combining TESSERACT-OCR to perform character recognition, page data can be accurately captured and recognized, and the reliability and stability of the test are enhanced. Furthermore, the identification result is verified through the preset verification rule, so that the accuracy of page information is ensured, the potential risk caused by information messy codes is effectively reduced, and the operation and maintenance efficiency and the safety of the data center are improved.
Drawings
In order to more clearly illustrate the technical solutions of the present application, the drawings that are needed in the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of an embodiment of a method for automatically checking BMC information according to the present application;
FIG. 2 is a flowchart illustrating another embodiment of a method for automatically checking BMC information according to the present application;
FIG. 3 is a flowchart illustrating another embodiment of a method for automatically checking BMC information according to the present application;
FIG. 4 is a flowchart illustrating another embodiment of a method for automatically checking BMC information according to the present application;
FIG. 5 is a flowchart illustrating another embodiment of a method for automatically checking BMC information according to the present application;
FIG. 6 is a schematic structural diagram of an embodiment of a testing apparatus for automatically checking BMC information according to the present application;
fig. 7 is a schematic structural diagram of another embodiment of a testing apparatus for automatically checking BMC information according to the present application.
Detailed Description
The application provides a test method, a device and a storage medium for automatically checking BMC information, which are used for solving the problem that information mess codes on web cannot be prevented in the traditional interface test.
It should be noted that the method for automatically checking BMC information provided by the present application may be applied to a terminal, and may also be applied to a server, for example, the terminal may be a smart phone or a fixed terminal such as a computer, a tablet computer, a smart television, a smart watch, a portable computer terminal, or a desktop computer. For convenience of explanation, the present application is exemplified by using the terminal as the execution subject.
Referring to fig. 1, fig. 1 is a schematic diagram illustrating an embodiment of a method for automatically checking BMC information according to the present application, the method includes:
S101, logging in a BMC login page by using an automation tool according to configuration file data so as to acquire a BMC user page;
BMC refers to a baseboard management controller, and is mainly used for monitoring and managing a dedicated controller of a server. It is typically contained within the motherboard of the server or within the main circuit board of the device being monitored, as part of the intelligent platform control interface. Automation tool Selenium is an open source automation framework for Web application testing that can simulate various operations of a user in a browser, such as clicking, inputting, navigating, etc., supporting multiple programming languages. In the scheme, selenium is mainly utilized to realize the operation of automatically logging in the BMC login page.
In this embodiment, before logging in the BMC login page, first setting yaml configuration information, including filling in a complete path of ChromeDriver executable file, determining a URL path of the BMC login page, and adding corresponding device login information for each tested BMC device, including a user name, a password, and an IP address. Next, configure Selenium the environment, including after the Python installation in the system is completed, add the Python installation path to the system environment variables, use PIP INSTALL selenium command install Selenium tool, download ChromeDriver corresponding to the Chrome browser version, and place ChromeDriver in the root directory of the Chrome browser installation. The configuration file is then read by means of the yaml library of Python, the file contents are parsed into Python dictionary, from which BMC login data is obtained, containing the user names, passwords and IP addresses of the multiple BMC devices, and ChromeDriver data, i.e. ChromeDriver executable file path. Then, using Selenium tools, call setup_chrome_options functions to configure Chrome options, such as disabling SSL certificate checking, specifying unique user data directories, etc., create service objects from ChromeDriver data, and create browser driver instances in combination with the configured target Chrome options. Further, by using the created browser driving example, for each BMC device, a complete BMC login page address is spliced through the IP address and the login URL in the configuration file, and the complete BMC login page address is accessed. Still further, an explicit wait mechanism is used to ensure that the user name input box, password input box, and login button of the login page are all loaded. And finally, executing possible interference elements in the hidden page of the JavaScript code, respectively inputting the user name and the password of the BMC device in the configuration file into the corresponding input boxes of the BMC login page, and automatically clicking the login button to finish login operation, thereby obtaining the BMC user page.
S102, processing the BMC user page to obtain a user page screenshot;
In this embodiment, after entering the BCM user page, the system uses time. Sleep (8) to wait 8 seconds to ensure that all information of the page is loaded completely, because there may be asynchronous loading of page information. Subsequently, it is checked by means of the os library whether the directory holding the screenshot is present, and if this directory is not present, os.makedirs is called to create this directory. And finally, storing the current BMC user page screenshot to a designated directory by using a browser driving example, wherein a storage path is formed by combining the directory created before and the generated file name, and recording path information stored by the screenshot by using a logging library so as to quickly locate the screenshot position during subsequent checking and debugging.
S103, invoking TESSERACT-OCR according to preset position data to perform character recognition on the user page screenshot so as to acquire page data;
Tesserac is an open-source optical character recognition engine, which can recognize texts in multiple languages, is widely applied to the fields of document processing, digital libraries, mobile applications and the like, and is one of important tools in the fields of computer vision and natural language processing. OCR is a process of extracting text information from pictures by image recognition technology.
In this embodiment, before invoking TESSERACT-OCR, the TESSERACT environment needs to be configured first, including installing TESSERACT installation packages, and when installing, hooking text and english language packages, adding TESSERACT installation paths to system variables, after installing, verifying whether the language packages are successfully installed by executing "test-list-langs" commands, if languages such as "chi_sim", "eng", and "osd" can be listed, the installation is correct, then installing pytesseract library by using "PIP INSTALL PYTESSERACT", and configuring the paths thereof, thus completing TESSERACT environment configuration.
Next, a list region is defined that contains a plurality of crop region coordinates, where each coordinate tuple accurately represents the location of a particular information region in the screenshot. Then, using the Image module of the PIL library, the user page screenshot is opened by means of an image_open (image_path) function, where image_path is a specific path of the screenshot file. Subsequently, a traversal operation is performed on the region list. For each coordinate region in the list, the opened image is cropped by using an image region method, so that a small image containing specific information is obtained. Further, for each cropped small image, call the get_img_info function. In the function, the text recognition is performed by using an image_to_string method of pytesseract libraries, the method receives two parameters, wherein the first parameter image is an image needing text recognition, and the second parameter lang= 'chi_sim+eng' is used for designating the recognized language as Chinese simplified and English. By setting these parameters, TESSERACT-OCR engine will extract text information from the incoming image according to the set language and return the recognized text content as a string of characters, ultimately obtaining text information. Finally, unnecessary blank characters and line feed symbols are removed from the extracted text information, the recognition result is subjected to preliminary format adjustment, and then the processed text information is printed, so that page data can be obtained.
S104, judging whether the page data accords with a preset check rule;
In this embodiment, before checking, corresponding checking functions are respectively constructed according to different types that may occur in page data, such as product names, serial numbers, asset tags, and the like. Next, taking the product serial number as an example, it is known to consist of a product model PR2715B, an 8-bit date and a 2-bit lot, constructing a regular expression PR2715B- \d {8} - \d {2} $, wherein, "-" and "$" respectively define the start and end positions of the matching character string, ensuring that the whole character string strictly follows the set pattern; "PR2715B" specifies a fixed product model section, "\d {8} indicates that a consecutive 8-digit number is matched, exactly corresponding to the date section," \d {2} matches a 2-digit number, representing the batch section.
When performing the check operation, the system traverses the page data one by one. For each data, the field type is determined, and then a corresponding check function is called according to the field type. For example, the validate _name function is called when the product name data is encountered, and the validate _serial_number function is called when the product serial number data is encountered. And (3) within the check function, comparing field values corresponding to the field types by using a check rule. For a check function involving a regular expression, the field value will be matched against the corresponding regular expression. Then, if each field value can pass the corresponding check logic, it indicates that the page data meets the check rule, and step S105 is executed, and if any field value in the page data does not meet the corresponding check condition, i.e. does not meet the predefined check rule, step S106 is executed.
S105, executing the next BMC test;
In this embodiment, when it is determined that the page data meets the preset check rule, the next BMC login information is obtained from the configuration file data, and then the operations of screenshot, text recognition and check are sequentially performed. Each cycle is a complete testing process for a new BMC until all BMC login information in the configuration file data is traversed, and automatic batch testing for a plurality of BMC pages is achieved.
S106, recording difference data in the page data;
In this embodiment, when the page data does not conform to the preset check rule, logging is performed by using a logging library. The method comprises the steps of firstly configuring basic parameters of log record through a logging method, wherein the basic parameters comprise setting a log file name as a logging_error, setting a log level as a logging_error to record only logs with error levels and above and log formats, and the formats comprise time, log levels, message content and the like. And when the data is captured to be abnormal which does not accord with the verification rule, the field types in the difference data, such as the product name, the serial number and the like, the field values which are actually identified, the verification rule and other information are stored in the log file by using a logging method, so that the difference data can be recorded. Recording the difference data is helpful for subsequent analysis of the problem, and possible BMC abnormality, recognition error or configuration error and other conditions are found.
S107, submitting the difference data to manual review and executing the next BMC test.
In this embodiment, before the recorded difference data is submitted to the human review personnel, a detailed report file needs to be generated, which includes detailed information of the difference data, such as the device IP, the data type, the actual value, the expected value, and the like. And then the files containing the difference data are sent to related personnel by means of mails, instant messaging tools and the like. Besides the method for submitting the manual audit, the method can be set according to actual conditions, and is not particularly limited.
After the difference data is submitted, the system can continue to execute the next BMC test, acquire the next BMC login information from the configuration file data, and then sequentially perform screenshot, character recognition and verification operations. Each cycle is a complete testing process for a new BMC until all BMC login information in the configuration file data is traversed, and automatic batch testing for a plurality of BMC pages is achieved.
According to the embodiment, through intercepting the BMC login page screenshot and combining the preset position data to cut the key information area, possible information omission or misreading in the traditional testing method is effectively avoided. Then, by combining TESSERACT-OCR to perform character recognition, page data can be accurately captured and recognized, and the reliability and stability of the test are enhanced. Furthermore, the identification result is verified through the preset verification rule, so that the accuracy of page information is ensured, the potential risk caused by information messy codes is effectively reduced, and the operation and maintenance efficiency and the safety of the data center are improved.
Referring to fig. 2, fig. 2 is a schematic diagram of another embodiment of a method for automatically checking BMC information according to the present application, the method includes:
s201, reading a configuration file to obtain BMC login data and ChromeDriver data;
ChromeDriver is a separate executable file that serves as a bridge between the Chrome browser and the automation test tool Selenium, allowing the automation tool Selenium to control the Chrome browser behavior.
In this embodiment, when the configuration file is read, the configuration file is opened by using the utf-8 coding format, then the yaml. Safe_load method is used to analyze the content of the configuration file in the file into a dictionary data structure of Python, then a path of ChromeDriver is obtained through a chromedriver _path key, a storage position of ChromeDriver in the system is clarified, then a relative URL of a BMC login page is obtained through a logic_url key, wherein it is to be described that the URL is a uniform resource locator, which is an address used for identifying a certain resource on the internet, further, the URL is located into a bmcLists list of the dictionary data structure, each item is traversed, and the corresponding IP address, user name and password are respectively extracted from each BMC device information item according to the keys of bmc_ip, username and password, and finally the system separately organizes the obtained path of ChromeDriver into ChromeDriver data, and organizes the IP addresses, user names and passwords of a plurality of BMC login devices into the BMC data.
S202, creating a browser driving instance according to an automation tool, the ChromeDriver data and a target Chrome option;
The browser driven instance is an object created by automation tool Selenium in conjunction with ChromeDriver. The object has a series of methods that can be used to control the behavior of the Chrome browser, such as opening and closing the browser, accessing a particular web page, looking up and manipulating page elements, and so on. The target Chrome option is used for configuring parameters of the Chrome browser starting behavior according to specific test requirements.
In this embodiment, when creating the browser driver instance, according to the obtained ChromeDriver data, that is, the specific path of ChromeDriver, setting is performed for the target Chrome options, where these options are key to customizing the Chrome browser starting behavior. For example, the SSL certificate error is ignored by adding the-neighbor-identifier option, so that the program can access some untrusted sites, and the independence of different test environments is ensured by adding the-user-data-dir option and designating a temporary directory.
Next, in automation tool Selenium, service classes are introduced from selenium webdriver. Then, the Service class is used to import ChromeDriver paths and create an Options object to integrate the target Chrome option. And then, a webdriver.chrome method is called, and the configured Service object and Options object are used as parameters to be transmitted in. At this point Selenium will launch the Chrome browser with ChromeDriver and configure it according to the set options. Finally, the browser driver instance is successfully created.
S203, accessing a login page of the BMC by using the browser driving example;
In this embodiment, when accessing the BMC login page, the IP address of the BMC and the relative URL of the login page need to be obtained from the configuration file, the two are spliced into a complete BMC login page URL, and then the browser driver instance is used to access the complete BMC login page URL spliced into the complete BMC login page URL, so as to access the BMC login page.
S204, inputting the BMC login data into the login page to acquire a BMC user page.
In this embodiment, when the BMC login data is input to the BMC login page, the user name input box, the password input box and the login button on the login page need to be positioned by WebDriverWait types combined with the method in the expected_conditions module, then the user name and the password in the corresponding BMC login data are input to the corresponding input box by using the send_keys method, and the login operation is completed by automatically clicking the login button, so that the BMC user page can be obtained.
In this embodiment, the configuration file is read, so as to obtain the BMC login data and ChromeDriver data, so that the automation tool can quickly and accurately complete the login operation according to the corresponding data, and possible errors caused by manual input are avoided. And by utilizing ChromeDriver data and a browser driving example created by a target Chrome option, the real user behavior can be simulated, and various verification mechanisms of the BMC login page are effectively applied.
Referring to fig. 3, fig. 3 is a schematic diagram of another embodiment of a method for automatically checking BMC information according to the present application, the method includes:
s301, creating a Chrome option;
In this embodiment, when using the automation tool Selenium to operate the Chrome browser, a blank Chrome option object is first created, where it needs to be described that the Chrome option is a configuration set, and can customize the starting mode and behavior of the browser, and needs to be created by means of Options in a selenium. Webdriver. Chrome. Options module in the Selenium library, where the Options are just like a configuration container, and can add parameters started by various browsers.
S302, creating a user data directory by using a temporary file library;
In this embodiment, the Chrome browser stores the personal data of the user in the user data directory when running. In the context of automated testing, if multiple tests are run simultaneously, or different tests require mutually independent environments, a separate user data directory needs to be created for each test to avoid data interference. In Python, a user data directory can be created by means of tempfile temporary file libraries, and using mkdtemp () function therein, the mkdtemp () function generates a unique directory under the temporary directory of the system, which can be used as a temporary user data directory.
S303, inputting the user data directory and the starting parameters into the Chrome option to acquire a target Chrome option.
The startup parameters are used to specify additional configurations when the Chrome browser is started, for example, -ignow-authentication-error means to ignore SSL certificate errors, -disable-GPU means to disable GPU acceleration, etc., and these parameters may be set according to specific test requirements, and are not limited in detail herein.
In this embodiment, when the target Chrome option is acquired, a setup_chrome_options function needs to be called to create ChromeOptions objects, where the objects are used to receive various parameters to customize the browser launch behavior. In the process of receiving various parameters, an add_area () method can be used to add a user data directory in the form of-user-data-dir=path to this ChromeOptions object, and also add a startup parameter, such as-neighbor-identifier-error, etc. Special configurations can also be added by means of the add_exact_option () method. After these operations, the resulting ChromeOptions object is the target Chrome option with the specific configuration for creating the browser driver instance.
In the embodiment, the browser starting behavior is customized by creating the Chrome option, so that the browser can ignore SSL certificate errors, ensure that a specific site can be accessed, and meet the access requirement of the automation test on a special network environment. And creating a user data directory by using the temporary file library, providing an independent data space for each test instance, avoiding data interference among different tests, ensuring the independence and stability of the test environment, and improving the accuracy of the test result. The user data directory and the starting parameters are input to obtain the target Chrome option, when the browser instance is created, the browser can be started according to specific requirements, a solid foundation is laid for subsequent automatic operations, such as accessing a BMC login page, simulating user interaction and the like, and the whole automatic process is ensured to be smoothly carried out.
Referring to fig. 4, fig. 4 is a schematic diagram of another embodiment of a method for automatically checking BMC information according to the present application, the method includes:
s401, acquiring a cutting area according to the user page screenshot and preset position data;
In this embodiment, before acquiring the cropping area, coordinate information for cropping the image needs to be determined according to the actual position of the target information in the user page screenshot, and the coordinate information is represented in a tuple form, such as (x 1, y1, x2, y 2), where (x 1, y 1) represents the coordinates of the upper left corner of the cropping area, and (x 2, y 2) represents the coordinates of the lower right corner of the cropping area. Then, these tuple coordinates are stored in the regions list, and the position data regions list is obtained. The user page screen shots are then opened using the PIL library of Python. Then, traversing the regions list, clipping a corresponding region from the screenshot image using an image. The image () method returns a new image object, i.e., the image of the cropping area, according to the entered coordinates.
S402, invoking TESSERACT-OCR by using pytesseract library to perform character recognition on the clipping region so as to acquire text content;
In this embodiment, before invoking TESSERACT-OCR to perform text recognition on the clipping region, a TESSERACT-OCR engine needs to be installed and a pytesseract library is configured, in Python codes, a pytesseract library is imported, for each clipping region image, a pytesserac.image_to_string () function is invoked, the function imports the image as a parameter, and the TESSERACT-OCR engine is invoked internally to analyze the image, recognize text therein, and return the recognized text content string.
S403, preprocessing the text content to obtain page data.
In this embodiment, when processing text content, a series of cleaning operations are required for the identified text content. For example, blank characters before and after a text are removed by using a strip () method of a character string, special characters such as punctuation marks of recognition errors are replaced by a replace () method of the character string, and common recognition errors such as numerical and letter confusion are checked and corrected by using a regular expression. After these preprocessing steps, the obtained text data is the page data.
In this embodiment, by locating the clipping region, interference of background noise and other irrelevant information is avoided, so that OCR recognition is more accurate. And the process has high automation degree, can reduce the complexity and errors of manual operation, and particularly can save a great deal of time and labor cost when processing a great deal of screenshot. Then, by preprocessing the recognized text content, useful page data can be further refined, and convenience is provided for subsequent data analysis and processing.
Referring to fig. 5, fig. 5 is a schematic diagram of another embodiment of a method for automatically checking BMC information according to the present application, the method includes:
s501, traversing the page data to obtain a field type and a corresponding field value;
In this embodiment, the page data is generally composed of a plurality of data items, each of which contains two pieces of information of a field type and a field value. The data items are accessed sequentially one by one as the page data is traversed. Upon accessing each data item, the system will first identify and extract field type information that is used for selection of a subsequent verification rule. The system will then continue to extract the corresponding field value from the current data item and take the field value as the subject of the verification.
S502, selecting a target check rule from preset check rules according to the field type;
the check rule is a data set containing multiple types of field check rules, which sets corresponding verification criteria and logic for different field types. For example, for the sequence number field, the system will use a specific regular expression to verify that its format is expected, while for the power consumption field, the system will check if its value is within a specified range.
In this embodiment, after the field type and the field value are obtained, the system selects a target verification rule matching the preset verification rule from the preset verification rules. When a matched target check rule is selected, the system can perform accurate matching and screening to ensure that the selected check rule completely corresponds to the field type.
S503, judging whether the field value corresponding to the field type accords with the target check rule.
In this embodiment, the field value is checked according to the selected target check rule. Substituting the field value into the target check rule, and judging whether the field value meets the condition set in the rule. For example, the verification rule of the serial number is a format of the product model number, the date and the batch, if the field value meets the format requirement, the rule is judged to be met, and if the field value does not meet the format requirement, the rule is judged to be not met like the case of wrong format or illegal character inclusion.
In this embodiment, the type and value of each field can be obtained by traversing the page data, so as to provide a solid foundation for the subsequent verification. Then, according to the field types, the system can automatically select matched target verification rules, so that the pertinence and the accuracy of verification are ensured, manual intervention is reduced, and the operation cost is reduced.
By strictly comparing the field value with the target verification rule, the system can rapidly identify the data which does not meet the requirements, thereby effectively avoiding data errors or anomalies. The mechanism not only improves the efficiency of data processing, but also greatly enhances the reliability and safety of data.
Referring to fig. 6, fig. 6 is a schematic diagram illustrating an embodiment of a testing apparatus for automatically checking BMC information according to the present application, where the testing apparatus includes:
a login unit 601, configured to login to a BMC login page using an automation tool according to the configuration file data, so as to obtain a BMC user page;
the processing unit 602 is configured to process the BMC user page to obtain a user page screenshot;
the recognition unit 603 is configured to invoke TESSERACT-OCR according to preset location data to perform text recognition on the user page screenshot, so as to obtain page data;
A judging unit 604, configured to judge whether the page data accords with a preset check rule;
the first execution unit 605 is configured to execute a next BMC test when the determination unit determines that the page data meets a preset check rule.
Optionally, the login unit 601 is further configured to:
reading a configuration file to obtain BMC login data and ChromeDriver data;
creating a browser driving instance according to an automation tool, the ChromeDriver data and a target Chrome option;
accessing a login page of the BMC by using the browser driving example;
and inputting the BMC login data into the login page to acquire a BMC user page.
Optionally, the device further includes a configuration unit 606 for:
Creating a Chrome option;
creating a user data directory using the temporary file library;
and inputting the user data catalog and the starting parameters into the Chrome option to acquire a target Chrome option.
Optionally, the identifying unit 603 is further configured to:
acquiring a cutting area according to the user page screenshot and preset position data;
And calling TESSERACT-OCR to perform character recognition on the clipping region so as to acquire page data.
Optionally, the identifying unit 603 is specifically further configured to:
Using pytesseract library call TESSERACT-OCR to perform text recognition on the clipping region so as to acquire text content;
and preprocessing the text content to obtain page data.
Optionally, the determining unit 604 is further configured to:
Traversing the page data to obtain a field type and a corresponding field value;
Selecting a target check rule from preset check rules according to the field type;
and judging whether the field value corresponding to the field type accords with the target check rule.
Optionally, the apparatus further comprises a second execution unit 607 for:
if not, recording difference data in the page data;
And submitting the difference data to a manual review and executing the next BMC test.
Referring to fig. 7, fig. 7 is a schematic diagram of another embodiment of a test apparatus for automatically checking BMC information according to the present application, the apparatus includes:
a processor 701, a memory 702, an input/output unit 703, and a bus 704;
the processor 701 is connected to the memory 702, the input-output unit 703, and the bus 704;
the memory 702 holds a program, and the processor 701 calls the program to execute any of the methods described above.
The application also relates to a computer readable storage medium having a program stored thereon, which when run on a computer causes the computer to perform any of the methods described above.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of elements is merely a logical functional division, and there may be additional divisions of actual implementation, e.g., multiple elements or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of 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.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of the embodiments of the present application. The storage medium includes a usb disk, a removable hard disk, a read-only memory (ROM), a random-access memory (RAM, random access memory), a magnetic disk, an optical disk, or other various media capable of storing program codes.

Claims (10)

CN202510322464.2A2025-03-192025-03-19Test method, device and storage medium for automatically checking BMC informationPendingCN119847845A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202510322464.2ACN119847845A (en)2025-03-192025-03-19Test method, device and storage medium for automatically checking BMC information

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202510322464.2ACN119847845A (en)2025-03-192025-03-19Test method, device and storage medium for automatically checking BMC information

Publications (1)

Publication NumberPublication Date
CN119847845Atrue CN119847845A (en)2025-04-18

Family

ID=95360441

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202510322464.2APendingCN119847845A (en)2025-03-192025-03-19Test method, device and storage medium for automatically checking BMC information

Country Status (1)

CountryLink
CN (1)CN119847845A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN120161978A (en)*2025-05-162025-06-17宝德计算机系统股份有限公司 A BMC page automatic screenshot method, device and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN109450723A (en)*2018-10-112019-03-08郑州云海信息技术有限公司A kind of BMC Web network information display verifying automated testing method
US20190384666A1 (en)*2018-06-132019-12-19Dell Products, L.P.Capturing video data and serial data during an information handling system failure
CN113742559A (en)*2021-09-072021-12-03平安科技(深圳)有限公司 Keyword detection method and device, electronic equipment, storage medium
CN118626322A (en)*2024-07-252024-09-10山东云海国创云计算装备产业创新中心有限公司 A RAID card testing method, system, terminal and medium based on UEFI management interface

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20190384666A1 (en)*2018-06-132019-12-19Dell Products, L.P.Capturing video data and serial data during an information handling system failure
CN109450723A (en)*2018-10-112019-03-08郑州云海信息技术有限公司A kind of BMC Web network information display verifying automated testing method
CN113742559A (en)*2021-09-072021-12-03平安科技(深圳)有限公司 Keyword detection method and device, electronic equipment, storage medium
CN118626322A (en)*2024-07-252024-09-10山东云海国创云计算装备产业创新中心有限公司 A RAID card testing method, system, terminal and medium based on UEFI management interface

Cited By (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN120161978A (en)*2025-05-162025-06-17宝德计算机系统股份有限公司 A BMC page automatic screenshot method, device and storage medium

Similar Documents

PublicationPublication DateTitle
CN110704304B (en)Application program testing method and device, storage medium and server
US9846634B2 (en)Visual graphical user interface verification
US8171406B1 (en)Automating user interface navigation
US9836385B2 (en)Cross-browser web application testing tool
CN114328276B (en)Test case generation method and device, and test case display method and device
WO2018010552A1 (en)Test method and device
CN119847845A (en)Test method, device and storage medium for automatically checking BMC information
CN106550038B (en) A data configuration diagnosis system and method of a digital control system
CN112540924A (en)Interface automation test method, device, equipment and storage medium
CN109783355A (en)Page elements acquisition methods, system, computer equipment and readable storage medium storing program for executing
CN117370203B (en)Automatic test method, system, electronic equipment and storage medium
US20170161181A1 (en)Testing support system, and testing support method
CN120123250B (en) Multilingual interface consistency testing method, device, equipment and storage medium
CN113419738A (en)Interface document generation method and device and interface management equipment
CN107797917B (en)Performance test script generation method and device
CN113094281B (en)Test method and device for hybrid App
CN111062039A (en)Multi-standard security reference detection method and system, target host and server
CN111026604B (en)Log file analysis method and device
JP4215255B2 (en) Degradation confirmation inspection method, degradation confirmation inspection system, and program therefor
CN117667716A (en)Page testing method and device and electronic equipment
CN111538994A (en)System security detection and repair method, device, storage medium and terminal
CN115470152A (en)Test code generation method, test code generation device, and storage medium
CN116719736A (en)Test case generation method and device for testing software interface
CN113761402B (en)Link debugging method, device, equipment and storage medium
CN115599683A (en)Automatic testing method, device, equipment and storage medium

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination

[8]ページ先頭

©2009-2025 Movatter.jp