US-12619508-B2 - Method of testing expansion card, electronic device, and testing system
Abstract
A method of testing an expansion card includes configuring a configuration file according to contents of instructions of a controller, which may be received by the expansion card, and contents of expected data corresponding to the instructions. Testing instructions are generated based on the configuration file. The testing instructions are sent to the expansion card. Returned data returned from a firmware of the expansion card by responding the testing instructions. Whether an electronic device communicates with the expansion card successfully is determined based on the returned data. An electronic device and a testing system are also provided.
Inventors
- Jie Yuan
- Xin Chen
Assignees
- FULIAN PRECISION ELECTRONICS (TIANJIN) CO., LTD.
Dates
- Publication Date
- 20260505
- Application Date
- 20240909
- Priority Date
- 20240417
Claims (17)
- 1 . A method of testing an expansion card, applied in an electronic device; the electronic device comprises a storage medium and a processor; the storage medium stores computer programs; and the processor executes the computer programs to implement following processes: acquiring contents of instructions of a controller corresponding to the expansion card; acquiring contents of expected data corresponding to the contents of the instructions in response to the expansion card receiving the contents of instructions; configuring at least one configuration file based on the contents of instructions and the contents of expected data; wherein the controller is a baseboard management controller; generating testing instructions based on the at least one configuration file; sending the testing instructions to the expansion card; receiving returned data from firmware of the expansion card, which is generated while executing the testing instructions; determining whether the electronic device communicates with the expansion card successfully based on the returned data; parsing the returned data based on receiving parameters of the at least one configuration file; and generating a log file based on the parsed returned data in response to the returned data been parsed successfully; wherein determining whether the electronic device communicates with the expansion card successfully based on the returned data comprises: reading contents of a state flag in the log file, wherein in a case that the contents of the state flag indicate that the electronic device communicates with the expansion card successfully, determining the electronic device is communicating with the expansion card; and in case that the contents of the state flag indicate that the electronic device fails to communicate with the expansion card, triggering an abnormal warning.
- 2 . The method of claim 1 , wherein generating the testing instructions based on the at least one configuration file comprises: reading sending parameters in the at least one configuration file; and filling the sending parameters in a specified format and generating the testing instructions.
- 3 . The method of claim 1 , after parsing the returned data based on the receiving parameters of the at least one configuration file, the method further comprising: in a case that the returned data is parsed unsuccessfully, triggering the abnormal warning.
- 4 . The method of claim 1 , after generating the testing instructions based on the at least one configuration file, the method further comprising: determining whether a number of the testing instructions is larger than or equal to a specified number, wherein in a case that the number of the testing instructions is less than the specified number, sending the testing instructions to the expansion card; and in a case that the number of the testing instructions is larger than or equal to the specified number, stopping testing.
- 5 . The method of claim 1 , before configuring the at least one configuration file based on the contents of the instructions, and contents of expected data, the method further comprising: obtaining a device address of the expansion card and a channel address; wherein the contents of the instructions is acquired based on the device address of the expansion card and the channel address.
- 6 . The method of claim 1 , wherein a transmission manner of the testing instructions from the electronic device to the expansion card and the returned data from the expansion card to the electronic device comprises an out-of-band manner, or an in-band manner.
- 7 . The method of claim 1 , wherein the acquired number of the testing instructions is related to the number of at least one configuration file, each testing instruction is generated based on one configuration file.
- 8 . An electronic device comprises: a processor, configured to execute computer programs; a non-transitory computer readable storage medium, configured to store the computer programs; the computer programs are executed by the processor to implement following instructions: acquiring contents of instructions of a controller corresponding to an expansion card; acquiring contents of expected data corresponding to the contents of the instructions in response to the expansion card receiving the contents of instructions; configuring at least one configuration file based on the contents of instructions of a controller and contents of expected data; wherein the controller is a baseboard management controller; generating testing instructions based on the at least one configuration file; sending the testing instructions to the expansion card; receiving returned data from firmware of the expansion card, which is generated while executing the testing instructions; and determining whether the electronic device communicates with the expansion card successfully based on the returned data; parsing the returned data based on receiving parameters of the at least one configuration file; and generating a log file based on the parsed returned data in response to the returned data been parsed successfully; reading contents of a state flag in the log file; wherein in a case that the contents of the state flag indicate the electronic device communicates with the expansion card successfully, determining the electronic device communicates with the expansion card successfully; and in a case that the contents of the state flag indicate the electronic device fails to communicate with the expansion card, triggering an abnormal warning.
- 9 . The electronic device of claim 8 , wherein the processor further: reading sending parameters in the at least one configuration file; and filling the sending parameters in a specified format and generating the testing instructions.
- 10 . The electronic device of claim 8 , wherein the processor further: in a case that the returned data is parsed unsuccessfully, triggering the abnormal warning.
- 11 . The electronic device of claim 8 , wherein the processor further: determining whether a number of the testing instructions is larger than or equal to a specified number, wherein in a case that the number of the testing instructions is less than the specified number, sending the testing instructions to the expansion card; and in a case that the number of the testing instructions is larger than or equal to the specified number, stopping testing.
- 12 . The electronic device of claim 8 , wherein the processor further: obtaining a device address of the expansion card and a channel address; wherein the contents of the instructions is acquired based on the device address of the expansion card and the channel address.
- 13 . A testing system comprises an electronic device and an expansion card; wherein the electronic device is configured to: acquire contents of instructions of a controller corresponding to the expansion card; acquire contents of expected data corresponding to the contents of the instructions in response to the expansion card receiving the contents of instructions; configure at least one configuration file based on the contents of instructions of a controller, and contents of expected data; wherein the controller is a baseboard management controller; generate testing instructions based on the at least one configuration file; send the testing instructions to the expansion card; receive returned data from firmware of the expansion card, which is generated while executing the testing instructions; and determines whether the electronic device communicates with the expansion card successfully based on the returned data; wherein the electronic device is also configured to parse the returned data based on receiving parameters of the at least one configuration file, and generate a log file based on the parsed returned data when the returned data is parsed successfully; the electronic device is also configured to read contents of a state flag in the at least one configuration file; in a case that the contents of the state flag indicate that the electronic device communicates with the expansion card successfully, the electronic device communicates with the expansion card successfully; in case that the contents of the state flag indicate that the electronic device fails to communicate with the expansion card, an abnormal warning is generated.
- 14 . The testing system of claim 13 , wherein the electronic device is also configured to read sending parameters in the at least one configuration file, and fill the sending parameters in a specified format and generating the testing instructions.
- 15 . The testing system of claim 13 , wherein in a case that the returned data is parsed unsuccessfully, the abnormal warning is triggered.
- 16 . The testing system of claim 13 , wherein the electronic device is also configured to determine whether a number of the testing instructions is larger than or equal to a specified number; in a case that the number of the testing instructions is less than the specified number, the testing instructions are sent to the expansion card; in a case that the number of the testing instructions is larger than or equal to the specified number, stopping testing.
- 17 . The testing system of claim 13 , wherein the electronic device is also configured to obtain a device address of the expansion card and a channel address; wherein the contents of the instructions is acquired based on the device address of the expansion card and the channel address.
Description
TECHNICAL FIELD The present application generally relates to server technology, and particularly to a method of testing expansion card, an electronic device, and a testing system. BACKGROUND A server includes an expansion card and a baseboard management controller (BMC). Each of the expansion card and the BMC includes firmware. While the firmware in the expansion card and the BMC is initially completed. For ensuring the accuracy of the firmware, the firmware in the expansion card and the BMC need to be executed for testing the accuracy of the firmware in the expansion card and/or the BMC. During developing the firmware in the expansion card and the BMC, a correctness of each firmware in the expansion card and the BMC is low, thus multiple tests are needed, which takes time and manpower. The developments of the firmware in the expansion card and the BMC are not synchronized with each other, a joint test is unable to be executed in time, and the developing process of each firmware in the expansion card and the BMC affects. Besides, there are two developing teams for the firmware of the expansion card and the BMC, the joint test is executed by the two developing teams. While executing the joint test, communication and collaborations between the two developing teams are not smooth, the joint test is unable to execute successfully, and data situation is unable to reflect clearly, which takes the manpower in the two developing teams and delays a process of developing the firmware of the expansion card and the BMC. Thus, before testing the accuracy of the firmware, whether the expansion card may communicate with the BMC needs to be test firstly. There is room for improvement in the art. BRIEF DESCRIPTION OF THE DRAWINGS Implementations of the present application will now be described, by way of example only, with reference to the attached figures. FIG. 1 is a diagram illustrating an embodiment of a testing system according to the present application. FIG. 2 is a flowchart illustrating a first embodiment of a method of testing an expansion card according to the present application. FIG. 3 is a diagram illustrating an embodiment of an application scenario of the testing system of FIG. 2 according to the present application. FIG. 4 is a flowchart illustrating a second embodiment of a method of testing an expansion card according to the present application. FIG. 5 is a diagram illustrating of an electronic device according to the present application. DETAILED DESCRIPTION The technical solutions in the embodiments of the present application will be clearly and completely described below which combine with reference to the accompanying drawings in the embodiments of the present application. Apparently, the described embodiments are some of the embodiments of the present application rather than all of the embodiments. Based on the embodiments of the present application, it is understandable to a person skilled in the art, any other embodiments obtained by persons skilled in the art without creative effort shall all fall into the scope of the present application. It will be understood that the specific embodiments described herein are merely some embodiments and not all. In general, the word “module,” as used herein, refers to logic embodied in hardware or firmware, or to a collection of software instructions, written in a programming language, for example, Java, C, or assembly. One or more software instructions in the modules may be embedded in firmware, such as an EPROM, magnetic, or optical drives. It will be appreciated that modules may comprise connected logic units, such as gates and flip-flops, and may comprise programmable units, such as programmable gate arrays or processors, such as a CPU. The modules described herein may be implemented as either software and/or hardware modules and may be stored in any type of computer-readable medium or other computer storage systems. The term “comprising” means “including, but not necessarily limited to”; it specifically indicates open-ended inclusion or membership in a so-described combination, group, series, and the like. The application is illustrated by way of example and not by way of limitation in the figures of the accompanying drawings in which like references indicate similar elements. It should be noted that references to “an” or “one” embodiment in this application are not necessarily to the same embodiment, and such references can mean “at least one.” It should be understood that, the connection relationship described in this application, indicates a direct or indirect connection. For example, connecting between A and B may be a direct connection between A and B, or may be indirect connection between A and B by using one or more other electronic components. For example, A is directly connected to C, and C is directly connected to B, so that A is connected to B by using C. In the description of the present application, unless other specified, “/” means “or”, for ex