BMC network device information automatic checking method, device, equipment and medium
By storing the network card information of the server under test in the test machine and using IPMI and RESTful API to automate the detection of BMC network device information, the problems of low efficiency and poor accuracy of manual testing are solved, and efficient and accurate automated testing is achieved.
Patent Information
- Application Number
- CN202310369385.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-07
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2043-04-07
AI Technical Summary
The current BMC network device information detection relies on manual testing, resulting in low testing efficiency and inaccurate results, which cannot meet the needs of automated server testing.
By pre-storing the network card information of the server under test in the test machine, the network device information query and verification are automated, including comparison of network card settings and network binding information, and consistency judgment is made by using IPMI and RESTful API to obtain actual and page information.
It enables automated testing of BMC network device information, reduces manual intervention, improves testing efficiency, and ensures the accuracy of results, thus meeting the requirements of automated server testing.
Smart Images

Figure CN116566870B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of server BMC test, and particularly relates to a BMC network device information automatic checking method, device, equipment and medium. BACKGROUND
[0002] BMC is the abbreviation of Baseboard Management Controller, which is a substrate management controller.
[0003] With the development of big data and AI technology, the requirements for servers as computing infrastructure are getting higher and higher. As a key component of servers, BMC is an important embodiment of the quality of servers, and therefore, the functions of BMC need to be tested before the production and shipment of servers.
[0004] The most common BMC test is to test the BMC network device information and functions, and to evaluate whether it can meet the standards. The current BMC network device information checking test is manually logged in the management interface of BMC by the test personnel, the corresponding network card device is selected, and the BMC network device information test is performed item by item, so it still remains in the manual test stage. This BMC network device information checking test is time-consuming and laborious, especially when multiple network cards are tested on a server, the test efficiency is relatively low, and the test result is often inaccurate due to human influence, resulting in missed test and repeated test.
[0005] In summary, the current BMC network device information detection test uses manual method, the test efficiency is low, the test result is inaccurate, and it cannot meet the development requirements of test technology and the development requirements of server industry for highly automated test process.
[0006] In view of the above defects, it is necessary to provide a BMC network device information automatic checking method, device, equipment and medium. SUMMARY
[0007] In view of the above defects that the current BMC network device information detection test uses manual method, the test efficiency is low, the test result is inaccurate, and it cannot meet the server automation test requirements, the application provides a BMC network device information automatic checking method, device, equipment and medium to solve the above technical problems.
[0008] In the first aspect, the application provides a BMC network device information automatic checking method, comprising the following steps:
[0009] S1. A test environment is established based on a to-be-tested server and a test machine, and the network card information of the to-be-tested server is stored in the test machine in advance;
[0010] S2. The test machine sends a network device information query request to the server under test according to the stored network card information of the server under test, and obtains the network card information of the server under test;
[0011] S3. The test machine sets the shared network card of the baseboard management controller for the network card of the server under test in a network connection state in sequence, and verifies whether the actual baseboard management controller network binding information is consistent with the baseboard management controller network binding information on the baseboard management controller page, to complete the baseboard management controller network device information inspection.
[0012] Further, the step S1 specifically includes the following steps:
[0013] S11. Setting a test machine for the server under test;
[0014] S12. Establishing a network connection between the test machine and the server under test;
[0015] S13. Storing the correspondence between the network card code and the network card name of the server under test in the test machine in advance. The network card name is the network card name displayed on the BMC page.
[0016] Further, the step S2 specifically includes the following steps:
[0017] S21. The test machine obtains the network card code of the server under test input by a user;
[0018] S22. The test machine queries the network card name of the server under test from the pre-stored correspondence between the network card code and the network card name according to the network card code input by the user;
[0019] S23. The test machine sends a network device information query request to the server under test, and obtains the network connection state and the network card location information of the server under test.
[0020] Further, the step S3 specifically includes the following steps:
[0021] S31. The test machine judges whether the network connection state of the network card of the server under test is normal;
[0022] If yes, go to step S32;
[0023] If no, go to step S34;
[0024] S32. The test machine sets the shared network card of the baseboard management controller for the network card of the server under test in sequence, sets the corresponding baseboard management controller network binding interface for the network card, and restarts the baseboard management controller after the setting is completed, to verify whether the actual baseboard management controller network binding information is consistent with the baseboard management controller network binding information on the baseboard management controller page;
[0025] If yes, go to step S33;
[0026] If no, go to step S34;
[0027] S33. If the test is passed, the tester records the test result and saves the test record, and ends;
[0028] S34. If the test is failed, the tester records the test result and saves the test record.
[0029] Further, the step S31 includes the following steps:
[0030] S311. The tester locates a network card of the server to be tested;
[0031] S312. The tester determines whether at least one port of the located network card of the server to be tested accesses the local area network;
[0032] If yes, go to step S313;
[0033] If no, go to step S314;
[0034] S313. The tester determines that the network connection state of the located network card of the server to be tested is normal, and goes to step S32;
[0035] S314. The tester determines that the network connection state of the located network card of the server to be tested is abnormal, and goes to step S34.
[0036] Further, the step S32 includes the following steps:
[0037] S321. The tester sets a baseboard management controller shared network card for the located network card, and specifies a port of the located network card for the baseboard management controller shared use;
[0038] S322. The tester selects a network binding interface for the specified port of the located network card from the baseboard management controller;
[0039] S323. The tester restarts the baseboard management controller by using the IPMI command;
[0040] S324. The tester acquires the actual baseboard management controller network binding information through the presentation state transition type interface, and acquires the baseboard management controller network binding information of the baseboard management controller page through the intelligent platform management interface, and determines whether they are consistent;
[0041] If yes, go to step S325;
[0042] If no, go to step S34;
[0043] S325. The tester determines whether the specified port of the positioning network card is selected as the network binding interface of the baseboard management controller;
[0044] If yes, go to step S326;
[0045] If no, select the next network binding interface of the baseboard management controller and return to step S323;
[0046] S326. The tester determines whether the port of the positioning network card is specified;
[0047] If yes, go to step S327;
[0048] If no, specify the next port for the positioning network card and return to step S322;
[0049] S327. The tester determines whether the network card of the server under test is positioned;
[0050] If yes, go to step S33;
[0051] If no, position the next network card of the server under test and return to step S312.
[0052] Further, step S324 includes the following steps:
[0053] S3241. The tester obtains the actual LAN MAC address and IP address of the baseboard management controller through the presentation layer state transition interface;
[0054] S3242. The tester obtains the LAN MAC address and IP address of the baseboard management controller displayed on the baseboard management controller page through the intelligent platform management interface;
[0055] S3243. The tester determines whether the MAC address and IP address obtained in the two ways are consistent and not empty;
[0056] If yes, go to step S325;
[0057] If no, go to step S34.
[0058] In a second aspect, the present application provides a BMC network device information automatic checking device, which comprises a test environment building module and a tester; the tester is provided with a network card information obtaining module and a baseboard management controller network device information testing module;
[0059] The test environment building module is used for building a test environment based on a server under test and a tester, and pre-storing the network card information of the server under test in the tester;
[0060] The network card information acquisition module is configured to send a network device information query request to the server to be tested according to the stored network card information of the server to be tested, and acquire the network card information of the server to be tested.
[0061] The BMC network device information test module is configured to sequentially set a shared network card of a BMC for the network cards of the server to be tested in a network connection state according to the network card information of the server to be tested, and verify whether the actual BMC network binding information is consistent with the BMC network binding information on a BMC page, so as to complete the BMC network device information inspection.
[0062] Further, the test environment building module comprises:
[0063] The test machine setting unit is configured to set a test machine for the server to be tested.
[0064] The test connection establishing unit is configured to establish a network connection between the test machine and the server to be tested.
[0065] The network card code and name corresponding relationship storage unit is configured to pre-store the network card code and name corresponding relationship of the server to be tested in the test machine.
[0066] Further, the network card information acquisition module comprises:
[0067] The network card code acquisition unit is configured to acquire the network card code of the server to be tested input by a user.
[0068] The network card name query unit is configured to query the network card name of the server to be tested from the pre-stored network card code and name corresponding relationship according to the network card code input by the user.
[0069] The network device information request unit is configured to send a network device information query request to the server to be tested, and acquire the network connection state and the network card position information of the network card of the server to be tested.
[0070] Further, the BMC network device information test module comprises:
[0071] The network card connection state judgment unit is configured to judge whether the network connection state of the network card of the server to be tested is normal.
[0072] The BMC network device information verification unit is configured to, when the network card connection state is normal, sequentially set a shared network card of a BMC for the network card of the server to be tested, set a corresponding BMC network binding interface for the network card, and restart the BMC after the setting is completed, and verify whether the actual BMC network binding information is consistent with the BMC network binding information on a BMC page.
[0073] The test passing recording unit is configured to record and save the test passing result when the actual BMC network binding information is consistent with the BMC network binding information on the BMC page.
[0074] The test failure recording unit is configured to record and save the test failure result when the network card network connection state is abnormal or the actual BMC network binding information is inconsistent with the BMC network binding information on the BMC page.
[0075] Further, the network card connection state judging unit comprises:
[0076] The network port positioning subunit is configured to position one network card of the server to be tested.
[0077] The positioned network port connection judging subunit is configured to judge whether at least one port of the positioned network card of the server to be tested accesses the local area network.
[0078] The network connection state normal judging subunit is configured to judge that the network connection state of the positioned network card of the server to be tested is normal when at least one port of the positioned network card of the server to be tested accesses the local area network.
[0079] The network connection state abnormal judging subunit is configured to judge that the network connection state of the positioned network card of the server to be tested is abnormal when no port of the positioned network card of the server to be tested accesses the local area network.
[0080] Further, the BMC network device information verifying unit comprises:
[0081] The positioned network card sharing setting subunit is configured to set the positioned network card as the BMC shared network card and specify one port of the positioned network card as the BMC shared port.
[0082] The network binding interface selecting subunit is configured to select one network binding interface for the specified port of the positioned network card from the BMC.
[0083] The BMC restarting subunit is configured to restart the BMC by using the IPMI command.
[0084] The BMC shared network card information checking subunit is configured to acquire the actual BMC network binding information through the presentation layer state transition type interface and acquire the BMC network binding information on the BMC page through the intelligent platform management interface, and judge whether the actual BMC network binding information is consistent with the BMC network binding information on the BMC page.
[0085] The network binding interface selecting judging subunit is configured to judge whether the network binding interface selection for the specified port of the positioned network card is completed.
[0086] The next network interface binding subunit is used for selecting the next network binding interface of the baseboard management controller when the baseboard management controller network binding interface is not selected completely.
[0087] The positioning network port designation judgment subunit is used for judging whether the port of the positioning network card is designated completely when the network binding interface of the baseboard management controller is selected completely.
[0088] The next port designation subunit of the positioning network card is used for designating the next port for the positioning network card when the port of the positioning network card is not designated completely.
[0089] The network card positioning judgment subunit is used for judging whether the network card of the server under test is positioned completely when the port of the positioning network card is designated completely.
[0090] The next network card positioning subunit of the server under test is used for positioning the next network card of the server under test when the network card of the server under test is not positioned completely.
[0091] In a third aspect, the present application provides a terminal, comprising:
[0092] a processor and a memory,
[0093] the memory is used for storing a computer program,
[0094] the processor is used for calling and running the computer program from the memory, so that the terminal executes the method of the terminal.
[0095] In a fourth aspect, the present application provides a computer storage medium, which stores instructions, when the instructions are run on a computer, the computer executes the method in the above aspects.
[0096] The present application has the advantages of
[0097] The automatic test method, device, equipment and medium for BMC network equipment information checking provided by the present application can automatically test the BMC network equipment information of the server under test through a testing machine, reduce the degree of manual participation, greatly improve the test efficiency, and are beneficial to improving the automatic test level.
[0098] In addition, the present application has reliable design principles, simple structure, and very wide application prospects.
[0099] Therefore, compared with the prior art, the present application has outstanding substantial characteristics and significant progress, and the beneficial effects of its implementation are also obvious. BRIEF DESCRIPTION OF DRAWINGS
[0100] In order to make the technical solutions in the embodiments of the present application or the prior art clearer, the accompanying drawings needed in the embodiments or prior art description will be briefly introduced. Obviously, those skilled in the art can obtain other drawings according to these drawings without any creative effort.
[0101] Figure 1 is a flowchart of embodiment 1 of the BMC network device information automatic checking method of the present application.
[0102] Figure 2 is a flowchart of embodiment 2 of the BMC network device information automatic checking method of the present application.
[0103] Figure 3 is a flowchart of judging the network connection state of the server to be tested.
[0104] Figure 4 is a flowchart of the BMC network device information checking of the present application.
[0105] Figure 5 is a schematic diagram of the BMC network device information automatic checking device of the present application.
[0106] In the figure, 1 is a test environment building module; 1.1 is a test machine setting unit; 1.2 is a test connection establishing unit; 1.3 is a network card code name corresponding relationship storage unit; 2 is a test machine; 3 is a network card information acquisition module; 3.1 is a network card code acquisition unit; 3.2 is a network card name query unit; 3.3 is a network device information request unit; 4 is a BMC network device information test module; 4.1 is a network card connection state judging unit; 4.2 is a BMC network device information verification unit; 4.3 is a test passing recording unit; and 4.4 is a test failure recording unit. DETAILED DESCRIPTION
[0107] In order to make the technical solutions in the embodiments of the present application or the prior art clearer, the accompanying drawings needed in the embodiments or prior art description will be briefly introduced. Obviously, those skilled in the art can obtain other drawings according to these drawings without any creative effort.
[0108] IPMI is the abbreviation of Intelligent Platform Management Interface, which means intelligent platform management interface.
[0109] RESTful API is short for Representational State Transfer Application Programming Interface.
[0110] Example 1:
[0111] like Figure 1 As shown, the present invention provides an automatic method for checking BMC network device information, comprising the following steps:
[0112] S1. Build a test environment based on the server under test and the test machine, and store the network card information of the server under test in advance on the test machine;
[0113] S2. The test machine sends a network device information query request to the server under test based on the stored network card information of the server under test, and obtains the network card information of the server under test;
[0114] S3. The test machine performs BMC shared network card settings on the network cards of the server under test that are in network connection state according to the network card information of the server under test, and verifies whether the actual BMC network binding information is consistent with the BMC network binding information on the BMC page, thus completing the BMC network device information check.
[0115] Example 2:
[0116] like Figure 2 As shown, the present invention provides an automatic method for checking BMC network device information, comprising the following steps:
[0117] S1. Set up a test environment based on the server under test and the test machine, and store the network card information of the server under test in advance on the test machine; the specific steps of step S1 are as follows:
[0118] S11. Configure the test machine for the server under test;
[0119] S12. Establish a network connection between the test machine and the server under test;
[0120] S13. Pre-store the correspondence between the network card code and the network card name of the server under test on the test machine; the network card name is the network card name displayed on the BMC page;
[0121] S2. The test machine sends a network device information query request to the server under test based on the stored network card information of the server under test, and obtains the network card information of the server under test; the specific steps of step S2 are as follows:
[0122] S21. The test machine obtains the network card code of the server under test input by the user;
[0123] S22. The test machine queries the network card name of the server under test from the pre-stored correspondence between network card codes and network card names according to the network card code input by the user;
[0124] S23. The test machine sends a network device information query request to the server under test to obtain the network connection state and the location information of the network card of the server under test;
[0125] S3. The test machine sets the BMC shared network card for the network card of the server under test in a network connection state in sequence according to the network card information of the server under test, and verifies whether the actual BMC network binding information is consistent with the BMC network binding information on the BMC page, to complete the BMC network device information inspection; the step S3 specifically includes the following steps:
[0126] S31. The test machine judges whether the network connection state of the network card of the server under test is normal;
[0127] If yes, go to step S32;
[0128] If no, go to step S34;
[0129] S32. The test machine sets the BMC shared network card for the network card of the server under test in sequence, sets the corresponding BMC network binding interface for the network card, and restarts the BMC after the setting is completed, and verifies whether the actual BMC network binding information is consistent with the BMC network binding information on the BMC page;
[0130] If yes, go to step S33;
[0131] If no, go to step S34;
[0132] S33. It is determined that the test is passed, the test machine records the test passing result and saves the test record, and the process ends;
[0133] S34. It is determined that the test fails, and the test machine records the test failure result and saves the test record.
[0134] Embodiment 3:
[0135] As shown in Figure 2 , the present application provides a kind of BMC network device information automatic inspection method, including the following steps:
[0136] S1. based on the server under test and test machine build test environment, and pre-stored network card information of the server under test in test machine;Step S1 specifically includes the following steps:
[0137] S11. set test machine for the server under test;
[0138] S12. establish the network connection between test machine and the server under test;
[0139] S13. Pre-storing the correspondence between the network card code of the server to be tested and the network card name in the test machine; the network card name is the network card name displayed on the BMC page of the network card;
[0140] S2. The test machine sends a network device information query request to the server to be tested according to the stored network card information of the server to be tested, and obtains the network card information of the server to be tested; the specific steps of step S2 are as follows:
[0141] S21. The test machine obtains the network card code of the server to be tested input by the user;
[0142] S22. The test machine queries the network card name of the server to be tested from the pre-stored correspondence between the network card code and the network card name according to the network card code input by the user;
[0143] S23. The test machine sends a network device information query request to the server to be tested, and obtains the network connection state of the network card of the server to be tested and the network card position information;
[0144] S3. The test machine sequentially performs BMC shared network card setting on the network card of the server to be tested in the network connection state according to the network card information of the server to be tested, and verifies whether the actual BMC network binding information is consistent with the BMC network binding information on the BMC page, thereby completing the BMC network device information inspection; the specific steps of step S3 are as follows:
[0145] S31. The test machine judges whether the network connection state of the network card of the server to be tested is normal;
[0146] If yes, go to step S32;
[0147] If no, go to step S34;
[0148] As shown in Figure 3 the specific steps of step S31 are as follows:
[0149] S311. The test machine locates one network card of the server to be tested;
[0150] S312. The test machine judges whether at least one port of the located network card of the server to be tested accesses a local area network;
[0151] If yes, go to step S313;
[0152] If no, go to step S314;
[0153] S313. The test machine determines that the network connection state of the located network card of the server to be tested is normal, and goes to step S32;
[0154] S314. The test machine determines that the network connection state of the located network card of the server to be tested is not normal, and goes to step S34;
[0155] S32. The tester sets the BMC shared network card for the network card of the server under test in turn, sets the corresponding BMC network binding interface for the network card, and restarts the BMC after the setting is completed, and verifies whether the actual BMC network binding information is consistent with the BMC network binding information on the BMC page;
[0156] If consistent, go to step S33;
[0157] If inconsistent, go to step S34;
[0158] As shown in FIG. 3, the specific steps of step S32 are as follows: Figure 4
[0159] S321. The tester sets the BMC shared network card for the positioning network card, and specifies a port of the positioning network card for BMC sharing;
[0160] S322. The tester selects a network binding interface for the specified port of the positioning network card from the BMC;
[0161] S323. The tester restarts the BMC using the IPMI command;
[0162] S324. The tester obtains the actual BMC network binding information through the RESTful API, and obtains the BMC network binding information on the BMC page through the IPMI, and judges whether they are consistent;
[0163] If consistent, go to step S325;
[0164] If inconsistent, go to step S34;
[0165] S325. The tester judges whether the selection of the network binding interface of the BMC for the specified port of the positioning network card is completed;
[0166] If yes, go to step S326;
[0167] If no, select the next network binding interface of the BMC, and return to step S323;
[0168] S326. The tester judges whether the port of the positioning network card is specified;
[0169] If yes, go to step S327;
[0170] If no, specify the next port for the positioning network card, and return to step S322;
[0171] S327. The tester judges whether the positioning of the network card of the server under test is completed;
[0172] If yes, go to step S33;
[0173] If not, locate the next network card of the server under test and return to step S312;
[0174] S33. The test is deemed passed. The testing machine records the test result and saves the test record. The test ends.
[0175] S34. The test is deemed a failure. The testing machine records the test failure result and saves the test record.
[0176] Example 4:
[0177] like Figure 2 As shown, the present invention provides an automatic method for checking BMC network device information, comprising the following steps:
[0178] S1. Set up a test environment based on the server under test and the test machine, and store the network card information of the server under test in advance on the test machine; the specific steps of step S1 are as follows:
[0179] S11. Configure the test machine for the server under test;
[0180] S12. Establish a network connection between the test machine and the server under test;
[0181] S13. Pre-store the correspondence between the network card code and the network card name of the server under test on the test machine; the network card name is the network card name displayed on the BMC page;
[0182] S2. The test machine sends a network device information query request to the server under test based on the stored network card information of the server under test, and obtains the network card information of the server under test; the specific steps of step S2 are as follows:
[0183] S21. The test machine obtains the network card code of the server under test input by the user; the network card under test uses a unique code, different network cards under test have different codes, the network card codes of the same server under test are different, and the network card codes of different servers under test are also different.
[0184] S22. The test machine queries the network card name of the server under test from the pre-stored mapping relationship between network card codes and network card names based on the network card code entered by the user. The pre-stored mapping relationship between network card codes and network card names in the test machine is used for querying before testing. It obtains the display name of the network card under test on the BMC page, which prepares for the next step of obtaining the network binding information of the network card under test displayed on the BMC page.
[0185] S23. The test machine sends a network device information query request to the server under test to obtain the network connection status and location information of the network card of the server under test;
[0186] The test machine sends a network device information query request to the server to be tested through the information sending unit, and the test machine and the server to be tested communicate using RESTful API; in order to successfully send the network device information query request, the test machine and the server to be tested can also use other communication modes;
[0187] The test machine receives the connection state and position information of each network card returned by the server to be tested through the information receiving unit. For example, if the server to be tested selects a two-port OCP3.0 network card, both ports are connected to a local area network, and the test machine obtains the network connection state that both ports are normally connected to the network, and the position of the network card to be tested on the server to be tested is the OCP; the network card to be tested can also be a PCIe network card;
[0188] S3. The test machine sets the BMC shared network card of the network card in the network connection state of the server to be tested in turn according to the network card information of the server to be tested, and verifies whether the actual BMC network binding information is consistent with the BMC network binding information on the BMC page, and completes the BMC network device information check; the specific steps of step S3 are as follows:
[0189] S31. The test machine judges whether the network connection state of the network card of the server to be tested is normal;
[0190] If yes, go to step S32;
[0191] If no, go to step S34;
[0192] As shown in Figure 3 , the specific steps of step S31 are as follows:
[0193] S311. The test machine locates a network card of the server to be tested;
[0194] S312. The test machine judges whether at least one port of the located network card of the server to be tested is connected to a local area network;
[0195] If yes, go to step S313;
[0196] If no, go to step S314;
[0197] S313. The test machine judges that the network connection state of the located network card of the server to be tested is normal, and goes to step S32;
[0198] S314. The test machine judges that the network connection state of the located network card of the server to be tested is not normal, and goes to step S34;
[0199] S32. The tester sets the BMC shared network card for the network card of the server to be tested in turn, sets the corresponding BMC network binding interface for the network card, and restarts the BMC after the setting is completed, and verifies whether the actual BMC network binding information is consistent with the BMC network binding information on the BMC page;
[0200] If consistent, go to step S33;
[0201] If inconsistent, go to step S34;
[0202] As shown in the figure, the specific steps of step S32 are as follows: Figure 4
[0203] S321. The tester sets the BMC shared network card for the positioning network card, and specifies a port of the positioning network card for BMC sharing; taking a two-port OCP3.0 network card as an example, first, specify the port corresponding to the first network port of the network card;
[0204] S322. The tester selects a network binding interface for the specified port of the positioning network card from the BMC; first, select ethO as the default network binding interface of the BMC from the BMC;
[0205] S223. The tester restarts the BMC using the IPMI command;
[0206] S324. The tester obtains the actual BMC network binding information through the RESTful API, and obtains the BMC network binding information on the BMC page through the IPMI, and judges whether they are consistent;
[0207] If consistent, go to step S325;
[0208] If inconsistent, go to step S34;
[0209] The specific steps of step S324 are as follows:
[0210] S3241. The tester obtains the actual LAN MAC address and IP address of the BMC through the RESTful API;
[0211] S3242. The tester obtains the BMC LAN MAC address and IP address displayed on the BMC page through the IPMI;
[0212] S3243. The tester judges whether the MAC address and IP address obtained in the two ways are consistent and not empty;
[0213] If yes, go to step S325;
[0214] If no, go to step S34;
[0215] S325. The tester determines whether the specified port of the positioning network card is selected as the network binding interface of the BMC; for example, the tester determines whether the specified port of the positioning network port is selected as the network binding interface eth0 and eth1 of the BMC;
[0216] If yes, go to step S326;
[0217] If no, select the next network binding interface of the BMC and return to step S323;
[0218] S326. The tester determines whether the port of the positioning network card is specified; for example, the tester determines whether the two connection state normal network ports of the OCP3.0 positioning network card are specified, ensuring that all network ports connected to the local area network of the server under test are tested;
[0219] If yes, go to step S327;
[0220] If no, specify the next port of the positioning network card and return to step S322;
[0221] S327. The tester determines whether the network card of the server under test is positioned;
[0222] If yes, go to step S33;
[0223] If no, position the next network card of the server under test and return to step S312;
[0224] S33. Determine that the test is passed, the tester records the test passing result and saves the test record, and the process ends;
[0225] S34. Determine that the test fails, the tester records the test failure result and saves the test record.
[0226] Example 5:
[0227] As shown in Figure 5 , the present application provides a kind of BMC network equipment information automatic checking device, including test environment building module 1 and tester 2;Tester 2 is equipped with network card information acquisition module 3 and BMC network equipment information test module 4;
[0228] Test environment building module 1 is used to build test environment based on server under test and tester, and the network card information of server under test is stored in tester in advance;
[0229] Network card information acquisition module 3 is used to send network equipment information inquiry request to server under test according to the network card information of server under test stored, and obtain the network card information of server under test;
[0230] The BMC network device information test module 4 is configured to sequentially perform BMC shared network card setting on the network cards of the to-be-tested server in a network connection state according to the network card information of the to-be-tested server, and verify whether the actual BMC network binding information is consistent with the BMC network binding information on the BMC page, so as to complete the BMC network device information inspection.
[0231] Embodiment 5:
[0232] As shown in Figure 5 The present application provides a BMC network device information automatic inspection device, which comprises a test environment building module 1 and a test machine 2; the test machine 2 is provided with a network card information acquisition module 3 and a BMC network device information test module 4.
[0233] The test environment building module 1 is configured to build a test environment based on a to-be-tested server and a test machine, and store the network card information of the to-be-tested server in the test machine in advance; the test environment building module 1 comprises:
[0234] The test machine setting unit 1.1 is configured to set the test machine for the to-be-tested server;
[0235] The test connection establishing unit 1.2 is configured to establish a network connection between the test machine and the to-be-tested server;
[0236] The network card code name corresponding relationship storage unit 1.3 is configured to store the corresponding relationship between the network card code and the network card name of the to-be-tested server in the test machine in advance;
[0237] The network card information acquisition module 3 is configured to send a network device information query request to the to-be-tested server according to the stored network card information of the to-be-tested server, and acquire the network card information of the to-be-tested server; the network card information acquisition module 3 comprises:
[0238] The network card code acquisition unit 3.1 is configured to acquire the network card code of the to-be-tested server input by a user;
[0239] The network card name query unit 3.2 is configured to query the network card name of the to-be-tested server from the pre-stored corresponding relationship between the network card code and the network card name according to the network card code input by the user;
[0240] The network device information request unit 3.3 is configured to send a network device information query request to the to-be-tested server, and acquire the network connection state and the network card position information of the network card of the to-be-tested server;
[0241] The BMC network device information test module 4 is configured to sequentially perform BMC shared network card setting on the network cards of the to-be-tested server in a network connection state according to the network card information of the to-be-tested server, and verify whether the actual BMC network binding information is consistent with the BMC network binding information on the BMC page, so as to complete the BMC network device information inspection; the BMC network device information test module 4 comprises:
[0242] The network card connection state judgment unit 4.1 is configured to judge whether the network connection state of the network card of the server under test is normal. The network card connection state judgment unit 4.1 comprises:
[0243] The network port positioning subunit is configured to position one network card of the server under test.
[0244] The positioning network port connection judgment subunit is configured to judge whether at least one port of the positioned network card of the server under test accesses the local area network.
[0245] The network connection state normal judgment subunit is configured to judge that the network connection state of the positioned network card of the server under test is normal when at least one port of the positioned network card of the server under test accesses the local area network.
[0246] The network connection state abnormal judgment subunit is configured to judge that the network connection state of the positioned network card of the server under test is abnormal when no port of the positioned network card of the server under test accesses the local area network.
[0247] The BMC network device information verification unit 4.2 is configured to, when the network connection state is normal, set the BMC shared network card for the network card of the server under test in sequence, set the corresponding BMC network binding interface for the network card, and restart the BMC after the setting is completed, and verify whether the actual BMC network binding information is consistent with the BMC network binding information on the BMC page. The BMC network device information verification unit 4.2 comprises:
[0248] The positioned network card shared setting subunit is configured to set the BMC shared network card for the positioned network card, and specify one port of the positioned network card as the BMC shared port.
[0249] The network binding interface selection subunit is configured to select one network binding interface for the specified port of the positioned network card from the BMC.
[0250] The BMC restart subunit is configured to restart the BMC by using the IPMI command.
[0251] The BMC shared network card information checking subunit is configured to obtain the actual BMC network binding information by using the RESTful API, and obtain the BMC network binding information on the BMC page by using the IPMI, and judge whether the actual BMC network binding information is consistent with the BMC network binding information on the BMC page.
[0252] The network binding interface selection judgment subunit is configured to judge whether the selection of the network binding interface of the BMC for the specified port of the positioned network card is completed.
[0253] The next network interface binding subunit is configured to select the next network binding interface of the BMC when the selection of the network binding interface of the BMC is not completed.
[0254] The positioning network port designation judgment subunit is configured to judge whether the ports of the positioning network card are designated when the network binding interface selection of the BMC is completed.
[0255] The positioning network card next port designation subunit is configured to designate the next port for the positioning network card when the ports of the positioning network card are not designated.
[0256] The network card positioning judgment subunit is configured to judge whether the network card of the server under test is positioned when the ports of the positioning network card are designated.
[0257] The server under test next network card positioning subunit is configured to position the next network card of the server under test when the network card of the server under test is not positioned.
[0258] The test pass recording unit 4.3 is configured to determine that the test passes when the actual BMC network binding information is consistent with the BMC network binding information on the BMC page, record the test pass result, and save the test record.
[0259] The test failure recording unit 4.4 is configured to determine that the test fails when the network connection state of the network card is not normal or the actual BMC network binding information is inconsistent with the BMC network binding information on the BMC page, record the test failure result, and save the test record.
[0260] Embodiment 6:
[0261] The application provides a device comprising a processor and a memory.
[0262] The memory is configured to store a computer program, and the processor is configured to call and run the computer program from the memory, so that the device executes the method described in Embodiment 1, Embodiment 2, Embodiment 3, or Embodiment 4.
[0263] Embodiment 7:
[0264] The application provides a storage medium, which stores instructions, and when the instructions are run on a computer, the computer executes the method described in Embodiment 1, Embodiment 2, Embodiment 3, or Embodiment 4.
[0265] Although the application has been described in detail with reference to the preferred embodiments, the application is not limited thereto. Various equivalent modifications or replacements can be made to the embodiments of the application by those skilled in the art without departing from the spirit and essence of the application, and these modifications or replacements shall be within the scope of the application. Any person skilled in the art can easily think of changes or replacements within the technical range disclosed by the application, and these changes or replacements shall be within the protection scope of the application. Therefore, the protection scope of the application shall be subject to the protection scope of the claims.
Claims
1. A method for automatically checking BMC network device information, characterized in that, Includes the following steps: S1. Build a test environment based on the server under test and the test machine, and store the network card information of the server under test in advance on the test machine, including the correspondence between the network card code and the network card name of the server under test; S2. The test machine sends a network device information query request to the server under test based on the stored network card information of the server under test, and obtains the network card information of the server under test, including the network connection status and location information of the network card of the server under test; S3. Based on the network card information of the server under test, the test machine sequentially configures the shared network cards of the baseboard management controller (BMC) for the network cards of the server under test that are in a network connection state, and verifies whether the actual network binding information of the baseboard management controller is consistent with the network binding information of the baseboard management controller on the baseboard management controller page, thus completing the baseboard management controller network device information check. The specific steps of step S3 are as follows: S31. The test machine determines whether the network connection status of the network card of the server under test is normal; the specific steps of S31 are as follows: S311. The test machine locates a network card of the server under test; S312. The test machine determines whether the network card of the server under test has at least one port connected to the local area network; If so, proceed to step S313; If not, proceed to step S314; S313. The test machine determines that the network connection status of the positioning network card of the server under test is normal, and proceeds to step S32; S314. The test machine determines that the network connection status of the positioning network card of the server under test is abnormal, and proceeds to step S34; S32. The test machine sequentially configures the shared network interface card (NIC) of the baseboard management controller for each NIC of the server under test, and simultaneously configures the corresponding baseboard management controller network binding interface for that NIC. After completing the configuration, the baseboard management controller is restarted to verify whether the actual baseboard management controller network binding information is consistent with the baseboard management controller network binding information on the baseboard management controller page. The specific steps of step S32 are as follows: S321. The tester sets the positioning network card to a shared network card for the baseboard management controller, and designates a port on the positioning network card for shared use by the baseboard management controller. S322. The tester selects a network bonding interface from the baseboard management controller for the designated port of the network card; S323. The test machine uses the IPMI command to restart the BMC; S324. The test machine obtains the actual baseboard management controller network binding information through the presentation layer state transition interface, and obtains the baseboard management controller network binding information on the baseboard management controller page through the intelligent platform management interface, and determines whether they are consistent; the specific steps of step S324 are as follows: S3241. The test machine obtains the actual local area network MAC address and IP address of the baseboard management controller through the presentation layer state transition interface; The S3242. Tester obtains the LAN MAC address and IP address of the baseboard management controller displayed on the baseboard management controller page through the intelligent platform management interface; S3243. The test machine determines whether the MAC address and IP address obtained by the two methods are consistent and not empty; If so, proceed to step S325; If not, proceed to step S34; S325. The tester determines whether the network binding interface of the baseboard management controller has been selected for the specified port of the positioning network card. If so, proceed to step S326; If not, select the next network bonding interface for the baseboard management controller and return to step S323; S326. The test machine determines whether the port of the network card has been specified. If so, proceed to step S327; If not, specify the next port for the network card and return to step S322; S327. The test machine determines whether the network card of the server under test has been located. If so, proceed to step S33; If not, locate the next network card of the server under test and return to step S312; S33. The test is deemed passed. The testing machine records the test result and saves the test record. The test ends. S34. The test is deemed a failure. The testing machine records the test failure result and saves the test record.
2. The automatic BMC network device information checking method as described in claim 1, characterized in that, The specific steps of step S1 are as follows: S11. Configure the test machine for the server under test; S12. Establish a network connection between the test machine and the server under test; S13. Pre-store the correspondence between the network card code and the network card name of the server under test on the test machine.
3. The automatic BMC network device information checking method as described in claim 2, characterized in that, The specific steps of step S2 are as follows: S21. The test machine obtains the network card code of the server under test input by the user; S22. The test machine queries the network card name of the server under test from the pre-stored mapping relationship between network card codes and network card names based on the network card code entered by the user; S23. The test machine sends a network device information query request to the server under test to obtain the network card network connection status and network card location information of the server under test.
4. An automatic information checking device for BMC network equipment, characterized in that, It includes a test environment setup module and a test machine; the test machine is equipped with a network card information acquisition module and a baseboard management controller network device information testing module; The test environment setup module is used to set up a test environment based on the server under test and the test machine, and to store the network card information of the server under test in advance on the test machine, including the correspondence between the network card code and the network card name of the server under test; The network interface card (NIC) information acquisition module is used to send a network device information query request to the server under test based on the stored NIC information of the server under test, and to obtain the NIC information of the server under test, including the NIC network connection status and NIC location information of the server under test. The baseboard management controller network device information testing module is used to configure the shared network cards of the baseboard management controller sequentially based on the network card information of the server under test that are in a network connection state, and to verify whether the actual baseboard management controller network binding information is consistent with the baseboard management controller network binding information on the baseboard management controller page, thus completing the baseboard management controller network device information check. The specific steps are as follows: S31. The test machine determines whether the network connection status of the network card of the server under test is normal; the specific steps of S31 are as follows: S311. The test machine locates a network card of the server under test; S312. The test machine determines whether the network card of the server under test has at least one port connected to the local area network; If so, proceed to step S313; If not, proceed to step S314; S313. The test machine determines that the network connection status of the positioning network card of the server under test is normal, and proceeds to step S32; S314. The test machine determines that the network connection status of the positioning network card of the server under test is abnormal, and proceeds to step S34; S32. The test machine sequentially configures the shared network interface card (NIC) of the baseboard management controller for each NIC of the server under test, and simultaneously configures the corresponding baseboard management controller network binding interface for that NIC. After completing the configuration, the baseboard management controller is restarted to verify whether the actual baseboard management controller network binding information is consistent with the baseboard management controller network binding information on the baseboard management controller page. The specific steps of step S32 are as follows: S321. The tester sets the positioning network card to a shared network card for the baseboard management controller, and designates a port on the positioning network card for shared use by the baseboard management controller. S322. The tester selects a network bonding interface from the baseboard management controller for the designated port of the network card; S323. The test machine uses the IPMI command to restart the BMC; S324. The test machine obtains the actual baseboard management controller network binding information through the presentation layer state transition interface, and obtains the baseboard management controller network binding information on the baseboard management controller page through the intelligent platform management interface, and determines whether they are consistent; the specific steps of step S324 are as follows: S3241. The test machine obtains the actual local area network MAC address and IP address of the baseboard management controller through the presentation layer state transition interface; The S3242. Tester obtains the LAN MAC address and IP address of the baseboard management controller displayed on the baseboard management controller page through the intelligent platform management interface; S3243. The test machine determines whether the MAC address and IP address obtained by the two methods are consistent and not empty; If so, proceed to step S325; If not, proceed to step S34; S325. The tester determines whether the network binding interface of the baseboard management controller has been selected for the specified port of the positioning network card. If so, proceed to step S326; If not, select the next network bonding interface for the baseboard management controller and return to step S323; S326. The test machine determines whether the port of the network card has been specified. If so, proceed to step S327; If not, specify the next port for the network card and return to step S322; S327. The test machine determines whether the network card of the server under test has been located. If so, proceed to step S33; If not, locate the next network card of the server under test and return to step S312; S33. The test is deemed passed. The testing machine records the test result and saves the test record. The test ends. S34. The test is deemed a failure. The testing machine records the test failure result and saves the test record.
5. An automatic BMC network device information checking device, characterized in that, Including processor and memory; The memory is used to store a computer program, and the processor is used to retrieve and run the computer program from the memory, causing the device to perform the method described in any one of claims 1-3.
6. A computer-readable storage medium, characterized in that, The storage medium stores instructions that, when run on a computer, cause the computer to perform the method described in any one of claims 1-3.
Citation Information
Patent Citations
Method for automatically testing BMC stability
CN106201813A
Method for verifying stability of NCSI (Network Connectivity Status Indicator)
CN108365998A