CN113765737B - Automatic test method and device for compatibility of network card and optical module, and electronic equipment - Google Patents
Automatic test method and device for compatibility of network card and optical module, and electronic equipment Download PDFInfo
- Publication number
- CN113765737B CN113765737B CN202110839417.7A CN202110839417A CN113765737B CN 113765737 B CN113765737 B CN 113765737B CN 202110839417 A CN202110839417 A CN 202110839417A CN 113765737 B CN113765737 B CN 113765737B
- Authority
- CN
- China
- Prior art keywords
- optical module
- information
- module
- network card
- library file
- 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.)
- Active
Links
- 230000003287 optical effect Effects 0.000 title claims abstract description 231
- 238000010998 test method Methods 0.000 title claims description 13
- 238000001514 detection method Methods 0.000 claims abstract description 61
- 238000012360 testing method Methods 0.000 claims abstract description 49
- 238000004891 communication Methods 0.000 claims description 7
- 238000000034 method Methods 0.000 abstract description 9
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000006467 substitution reaction Methods 0.000 description 2
- 238000013461 design Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000007689 inspection Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/50—Testing arrangements
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04B—TRANSMISSION
- H04B10/00—Transmission systems employing electromagnetic waves other than radio-waves, e.g. infrared, visible or ultraviolet light, or employing corpuscular radiation, e.g. quantum communication
- H04B10/07—Arrangements for monitoring or testing transmission systems; Arrangements for fault measurement of transmission systems
- H04B10/075—Arrangements for monitoring or testing transmission systems; Arrangements for fault measurement of transmission systems using an in-service signal
- H04B10/077—Arrangements for monitoring or testing transmission systems; Arrangements for fault measurement of transmission systems using an in-service signal using a supervisory or additional signal
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04B—TRANSMISSION
- H04B10/00—Transmission systems employing electromagnetic waves other than radio-waves, e.g. infrared, visible or ultraviolet light, or employing corpuscular radiation, e.g. quantum communication
- H04B10/07—Arrangements for monitoring or testing transmission systems; Arrangements for fault measurement of transmission systems
- H04B10/075—Arrangements for monitoring or testing transmission systems; Arrangements for fault measurement of transmission systems using an in-service signal
- H04B10/077—Arrangements for monitoring or testing transmission systems; Arrangements for fault measurement of transmission systems using an in-service signal using a supervisory or additional signal
- H04B10/0775—Performance monitoring and measurement of transmission parameters
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Physics & Mathematics (AREA)
- Electromagnetism (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
- Optical Communication System (AREA)
Abstract
The invention provides a method and a device for automatically testing compatibility of a network card and an optical module, and electronic equipment, wherein the method comprises the following steps: acquiring basic information of a network card; acquiring the current speed and the connection information of the optical module connected with the network card according to the acquired basic information; if the current speed is the set threshold speed, detecting the optical module and outputting a detection result; and calling the optical module parameter standard library file to compare with the detection result, and returning the comparison result. And when the acquired speed is the required speed, calling the optical module parameter standard library file of the speed to compare the test result. The compatibility test of various combinations of the network card and the optical module can be covered, the test efficiency is improved, and errors caused by manual operation and judgment are reduced.
Description
Technical Field
The invention relates to the technical field of automatic testing of compatibility of network cards, in particular to an automatic testing method, an automatic testing device and electronic equipment for compatibility of a network card and an optical module.
Background
The PCIe link bandwidth on the current server product is increasingly larger, the types and models of the corresponding supported various rate network card products are increased accordingly, and the optical module products supported by the corresponding network cards with each specification and model are also increased in batches due to the reasons of product requirements, supply requirements and the like.
The Form factor (such as SFP+/SFP28 and later, QSFP+/QSFP28 and later) of the optical module follows different management interface protocols (such as SFF8472/SFF 8636), each protocol value pair Identifier, connector, transceiver has a definition list, but each optical module manufacturer can adopt different hex value description, and if the value is inconsistent with the network card drive, the identification of the optical module is affected, and the normal communication of the network card is further affected; for example, the optical interface 1G/10G/25G network card, the corresponding optical module package is SFP/SFP+/SFP28, and the 3 package interfaces are compatible.
Therefore, the compatibility requirement of the network card and the optical module is that the manual test execution command and the judgment result of the tester bring great workload to the tester.
Disclosure of Invention
Aiming at the compatibility requirement of the network card and the optical module, the invention provides an automatic test method, an automatic test device and electronic equipment for the compatibility of the network card and the optical module, which solve the problem that a tester can bring great workload to the tester due to manual test execution command and judgment result.
The technical scheme of the invention is as follows:
in a first aspect, the present invention provides an automatic test method for compatibility between a network card and an optical module, including the following steps:
acquiring basic information of a network card;
acquiring the current speed and the connection information of the optical module connected with the network card according to the acquired basic information;
if the current speed is the set threshold speed, detecting the optical module and outputting a detection result;
and calling the optical module parameter standard library file to compare with the detection result, and returning the comparison result.
And when the acquired speed is the required speed, calling the optical module parameter standard library file of the speed to compare the test result. The mode covers compatibility tests of various combinations of the network card and the optical module, improves test efficiency, and reduces errors caused by manual operation and judgment.
Further, the step of obtaining the basic information of the network card device includes:
and classifying according to the manufacturers and specifications of the optical modules, and respectively establishing an optical module parameter standard library file. In order to facilitate the calling of corresponding optical module parameter standard library files in the subsequent comparison of test results, different specifications correspond to different optical module parameter standard library files.
Further, the step of establishing the optical module parameter standard library file includes:
acquiring register information of an optical module;
and setting corresponding standard values for the acquired register information respectively to form an optical module parameter standard library file. The standard value is set to facilitate the comparison of the subsequent detection result with the set standard value.
Further, the step of obtaining the current rate and the connection information of the optical module connected with the network card according to the obtained basic information includes:
acquiring connection information and current speed of an optical module connected with a network card according to the acquired basic information;
judging whether the connection state is the connection state according to the connection information;
if the connection state is not established, the detection is ended;
if yes, calling an optical module parameter standard library file corresponding to the set threshold rate, judging whether the current rate is the set threshold rate, and if yes, executing the steps of: detecting the optical module and outputting a detection result; otherwise, the test returns a value fail and the detection is ended.
And acquiring the current speed and the connection information of the optical module connected with the network card, and calling the speed and the connection state of the optical module standard library file contrast detection.
Further, in the step of detecting the optical module and outputting the detection result if the current rate is the set threshold rate, the step of detecting the optical module and outputting the detection result includes:
acquiring state parameter information of an optical module;
calling an optical module parameter standard library file corresponding to the set threshold rate;
and comparing the acquired state parameter information of the optical module with a standard value correspondingly established in a called optical module parameter standard library file, returning to a pass if the information is in a set range, and otherwise, returning to fail.
And comparing the detected parameter value with the acquired set standard value, and judging whether the detected value is in the assignment range.
Further, the standard value comprises a value and a range of parameters;
the step of comparing the acquired state parameter information of the optical module with the standard value correspondingly established in the called optical module parameter standard library file comprises the following steps:
comparing the acquired state parameter information of the optical module with assignment and range of corresponding parameters in an optical module parameter standard library file;
if the value is equal to the assigned value or within the set range, outputting information; if the output information is not equal to the assigned value and is not set in the range any more, the output information is inconsistent.
Further, the method further comprises:
acquiring basic information of a network card and simultaneously storing log information;
and comparing the acquired state parameter information of the optical module with assignment and range of corresponding parameters in the optical module parameter standard library file, and simultaneously storing log information.
In a second aspect, the invention further provides an automatic testing device for compatibility between the network card and the optical module, which comprises a network card information acquisition module, an optical module information acquisition module, a detection module and a result comparison module;
the network card information acquisition module is used for acquiring basic information of a network card;
the optical module state acquisition information module is used for acquiring the current speed and the connection information of the optical module connected with the network card according to the acquired basic information;
the detection module is used for detecting the optical module and outputting a detection result if the current speed is a set threshold speed;
and the result comparison module is used for calling the optical module parameter standard library file to compare with the detection result and returning the comparison result.
And when the acquired speed is the required speed, calling the optical module parameter standard library file of the speed, and comparing the test results. The mode covers compatibility tests of various combinations of the network card and the optical module, improves test efficiency, and reduces errors caused by manual operation and judgment.
Further, the device also comprises a creation module for classifying according to the manufacturer and specification of the optical module and respectively creating an optical module parameter standard library file. And classifying according to the manufacturers and specifications of the optical modules, and respectively establishing an optical module parameter standard library file. In order to facilitate the calling of corresponding optical module parameter standard library files in the subsequent comparison of test results, different specifications correspond to different optical module parameter standard library files.
Further, the creation module comprises a register information acquisition unit and a standard value setting unit;
the register information acquisition unit is used for acquiring register information of the optical module;
and the standard value setting unit is used for respectively setting corresponding standard values for the acquired register information to form an optical module parameter standard library file.
Further, the device also comprises a connection judging module and a speed judging module;
the connection judging module is used for judging whether the connection state is the connection state or not according to the connection information acquired by the optical module state acquisition information module; if the connection state is established, outputting information to a rate judging module;
and the rate judging module is used for calling the optical module parameter standard library file corresponding to the set threshold rate if the optical module is judged to be in the connection state, judging whether the current rate is the set threshold rate or not, and outputting information to the detecting module if the current rate is the set threshold rate. And acquiring the current speed and the connection information of the optical module connected with the network card, and calling the speed and the connection state of the optical module standard library file contrast detection.
Further, the detection module comprises an optical module state parameter acquisition unit, a calling unit and a parameter comparison unit;
the optical module state parameter acquisition unit is used for acquiring state parameter information of the optical module;
the calling unit is used for calling the optical module parameter standard library file corresponding to the set threshold rate;
and the parameter comparison unit is used for comparing the acquired state parameter information of the optical module with a standard value correspondingly established in the called optical module parameter standard library file. And comparing the detected parameter value with the acquired set standard value, and judging whether the detected value is in the assignment range.
Further, the standard value comprises a value and a range of parameters;
the parameter comparison unit is specifically used for comparing the acquired state parameter information of the optical module with assignment and range of corresponding parameters in the optical module parameter standard library file; if the value is equal to the assigned value or within the set range, outputting information; if the output information is not equal to the assigned value and is not set in the range any more, the output information is inconsistent.
Further, the network card information acquisition module is specifically configured to acquire basic information of a network card and store log information at the same time;
and the parameter comparison unit is also used for comparing the acquired state parameter information of the optical module with the assignment and range of the corresponding parameter in the optical module parameter standard library file and storing log information.
In a third aspect, the present invention further provides an electronic device, including a processor and a memory, where the processor and the memory complete communication with each other through a bus; the memory stores program instructions executable by the processor, the processor invoking the program instructions to perform the network card and optical module compatibility automated test method of the first aspect.
From the above technical scheme, the invention has the following advantages: when the compatibility test of the network card and the optical module is realized, the connection and parameter inspection of the optical module on the network card are automatically realized by virtue of a test program, the manual test execution command and judgment result of a tester are reduced, the compatibility test of various combinations of the network card and the optical module can be covered, the test efficiency is improved, and the errors caused by manual operation and judgment are reduced.
In addition, the invention has reliable design principle, simple structure and very wide application prospect.
It can be seen that the present invention has outstanding substantial features and significant advances over the prior art, as well as its practical advantages.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required to be used in the description of the embodiments or the prior art will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a schematic flow chart of a method of one embodiment of the invention.
Fig. 2 is a schematic flow chart of a method of another embodiment of the invention.
Fig. 3 is a schematic block diagram of an apparatus of one embodiment of the present invention.
In the figure, an 11-network card information acquisition module, a 22-optical module information acquisition module, a 33-connection judgment module, a 44-rate judgment module, a 55-detection module and a 66-result comparison module.
Detailed Description
In order to make the technical solution of the present invention better understood by those skilled in the art, the technical solution of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
As shown in fig. 1, embodiment 1 of the present invention provides an automated testing method for compatibility between a network card and an optical module, including the following steps:
step 11, obtaining basic information of the network card;
step 12: acquiring the current speed and the connection information of the optical module connected with the network card according to the acquired basic information;
step 13: if the current speed is the set threshold speed, detecting the optical module and outputting a detection result;
step 14: and calling the optical module parameter standard library file to compare with the detection result, and returning the comparison result.
And when the acquired speed is the required speed, calling the optical module parameter standard library file of the speed to compare the test result. The mode covers compatibility tests of various combinations of the network card and the optical module, improves test efficiency, and reduces errors caused by manual operation and judgment.
The embodiment 2 of the invention provides an automatic test method for compatibility of a network card and an optical module, which comprises the following steps:
step 21: and classifying according to the manufacturers and specifications of the optical modules, and respectively establishing an optical module parameter standard library file.
Step 22, obtaining basic information of the network card;
step 23: acquiring the current speed and the connection information of the optical module connected with the network card according to the acquired basic information;
step 24: if the current speed is the set threshold speed, detecting the optical module and outputting a detection result;
step 25: and calling the optical module parameter standard library file to compare with the detection result, and returning the comparison result.
In order to facilitate the calling of corresponding optical module parameter standard library files in the subsequent comparison of test results, different specifications correspond to different optical module parameter standard library files.
The embodiment 3 of the invention provides an automatic test method for compatibility of a network card and an optical module, which comprises the following steps:
step 31: acquiring register information of an optical module;
step 32: setting corresponding standard values for the acquired register information respectively to form an optical module parameter standard library file;
step 33, obtaining basic information of the network card;
step 34: acquiring the current speed and the connection information of the optical module connected with the network card according to the acquired basic information;
step 35: if the current speed is the set threshold speed, detecting the optical module and outputting a detection result;
step 36: and calling the optical module parameter standard library file to compare with the detection result, and returning the comparison result.
The standard value is set to facilitate the comparison of the subsequent detection result with the set standard value.
The embodiment 4 of the invention provides an automatic test method for compatibility of a network card and an optical module, which comprises the following steps:
step 41: acquiring register information of an optical module;
step 42: setting corresponding standard values for the acquired register information respectively to form an optical module parameter standard library file;
step 43, obtaining basic information of the network card;
step 44: acquiring the current speed and the connection information of the optical module connected with the network card according to the acquired basic information;
step 45: judging whether the connection state is the connection state according to the connection information; if the connection state is not established, the detection is ended; if so, go to step 46;
step 46: calling an optical module parameter standard library file corresponding to the set threshold rate;
step 47: judging whether the current speed is a set threshold speed, if so, executing step 48; otherwise, the test returns a value fail and the detection is ended.
Step 48: detecting the optical module and outputting a detection result;
step 49: and calling the optical module parameter standard library file to compare with the detection result, and returning the comparison result.
As shown in fig. 2, embodiment 5 of the present invention provides an automated testing method for compatibility between a network card and an optical module, which includes the following steps:
step 51: acquiring register information of an optical module;
step 52: setting corresponding standard values for the acquired register information respectively to form an optical module parameter standard library file;
step 53, obtaining basic information of the network card;
step 54: acquiring the current speed and the connection information of the optical module connected with the network card according to the acquired basic information;
step 55: judging whether the connection state is the connection state according to the connection information; if the connection state is not established, the detection is ended; if so, executing step 56;
step 56: calling an optical module parameter standard library file corresponding to the set threshold rate;
step 57: judging whether the current rate is a set threshold rate, if so, executing step 58; otherwise, return fail, go to step 61;
step 58: acquiring state parameter information of an optical module;
step 59: calling an optical module parameter standard library file corresponding to the set threshold rate;
step 60: comparing the acquired state parameter information of the optical module with a standard value correspondingly established in a called optical module parameter standard library file; judging whether the set range is within the set range, if so, returning to the pass, and executing step 61; otherwise, fail is returned and step 61 is performed.
Step 61: and (5) ending.
The standard value comprises the assignment and the range of the parameter; the step of comparing the acquired state parameter information of the optical module with the standard value correspondingly established in the called optical module parameter standard library file comprises the following steps: comparing the acquired state parameter information of the optical module with assignment and range of corresponding parameters in an optical module parameter standard library file; if the value is equal to the assigned value or within the set range, outputting information; if the output information is not equal to the assigned value and is not set in the range any more, the output information is inconsistent.
It should be noted that, the log information is saved while the basic information of the network card is obtained; and comparing the acquired state parameter information of the optical module with assignment and range of corresponding parameters in the optical module parameter standard library file, and simultaneously storing log information.
Specifically, classifying according to the manufacturers and specifications of the optical modules, and establishing an optical module parameter standard library file for automatically comparing with a detection result; the method is established according to the rate and the manufacturer: such as 10G SR (10G short range type) _vendor (Hisense/WTD …), 25G LR (25G long range type) _vendor, etc.; the optical module is used for detecting parameter assignment and range, comparing the standard with the test result and saving log;
such as: identify=0x03 (SFP);
Extended identifier=0x04(GBIC/SFP defined by 2-wire interface ID);
Connector=0x07(LC);
Transceiver codes=0x10 0x00 0x00 0x01 0x00 0x00 0x00 0x00;
Transceiver type=10G Ethernet:10G Base-SR;
BR,Nominal=10300MBd;
Length(OM3)=300m;
Laser wavelength=850nm;
vender name = preset name in advance according to different vendors (e.g. Intel Corp/Hisense/WTD …);
vender OUI = preset OUI values in advance according to different vendors, or directly assign 00:00:00;
vendor PN=preset PN IN advance according to different PN (such as AFBR-709DMZ-IN3, RTXM 228-551);
vendor SN=takes the actual value, judges the digit number;
date code=take actual value, judge digit number and time unit and format;
laser bias current =take the actual value, compare and whether in the range of assigning;
laser output power =take the actual value, compare and whether in the range of assigning;
receiver signal average optical power =take the actual value, compare and whether in the range of assigning;
module temperature =take the actual value, compare and whether in the range of assigning;
module voltage=take actual value, compare whether in the range of assignment;
specific standard values are assigned to the threshold part, and detection results are judged and compared with the parameter files;
such as: laser bias current high warning/alarm threshold: a specific standard value is given;
laser bias current low warning/alarm threshold, a specific standard value is given;
the network card is internally provided with an optical module, the switch is internally provided with the optical module, the network card is communicated with the switch, the compatibility of the network card and the internal optical module is tested through the communication between the network card and the switch, a program for detecting the optical module based on the network card under the linux OS is established, the optical module is detected, and a detection result is output:
(1) Acquiring basic information of a network card and storing log, model, FW and Driver;
ethtool–i device name、lspci|grep–i***
(2) Acquiring the current speed and link information of the network card equipment, and calling a standard library file to compare detected speed and link detected states;
ethtool–i device name
(3) Judging the connection state, judging the Link information obtained, and continuing the test, wherein the Link detected is that the yes program judges yes; judging no, stopping the test, and checking the optical module access and the cable connection;
(4) Judging the obtained current Speed, for example, the obtained current Speed is 10000Mb/s, an optical module standard library file corresponding to a 10G SR/10G LR optical module needs to be called, judging whether the current Speed is 10000Mb/s, if the Speed is not 10000Mb/s, testing a return value fail, and stopping the program; if the speed is 10000Mb/s, pass, the procedure continues;
(5) Acquiring optical module parameter state information
For example, ethtool-m device name
Calling an optical module standard library file to compare the test results item by item, and storing log returned pass or fail results; the compatibility test of various combinations of the network card and the optical module can be covered, the test efficiency is improved, and errors caused by manual operation and judgment are reduced.
The embodiment 6 of the invention also provides an automatic testing device for the compatibility of the network card and the optical module, which comprises a network card information acquisition module 11, an optical module information acquisition module 22, a detection module 55 and a result comparison module 66;
the network card information acquisition module 11 is used for acquiring basic information of a network card;
the optical module state acquisition information module 22 is configured to acquire current speed and connection information of an optical module connected to the network card according to the acquired basic information;
the detection module 55 is configured to detect the optical module and output a detection result if the current rate is a set threshold rate;
the result comparison module 66 is used for calling the optical module parameter standard library file to compare with the detection result and returning the comparison result.
And when the acquired speed is the required speed, calling the optical module parameter standard library file of the speed, and comparing the test results. The mode covers compatibility tests of various combinations of the network card and the optical module, improves test efficiency, and reduces errors caused by manual operation and judgment.
The embodiment 7 of the invention also provides an automatic testing device for the compatibility of the network card and the optical module, which comprises a network card information acquisition module 11, an optical module information acquisition module 22, a detection module 55, a result comparison module 66 and a creation module;
the creation module is used for classifying according to the manufacturers and specifications of the optical modules and respectively creating optical module parameter standard library files; the creation module comprises a register information acquisition unit and a standard value setting unit; the register information acquisition unit is used for acquiring register information of the optical module; the standard value setting unit is used for setting corresponding standard values for the acquired register information respectively to form an optical module parameter standard library file;
the network card information acquisition module 11 is used for acquiring basic information of a network card;
the optical module state acquisition information module 22 is configured to acquire current speed and connection information of an optical module connected to the network card according to the acquired basic information;
the detection module 55 is configured to detect the optical module and output a detection result if the current rate is a set threshold rate;
the result comparison module 66 is used for calling the optical module parameter standard library file to compare with the detection result and returning the comparison result.
In order to facilitate the calling of corresponding optical module parameter standard library files in the subsequent comparison of test results, different specifications correspond to different optical module parameter standard library files.
As shown in fig. 3, embodiment 8 of the present invention further provides an automatic testing device for compatibility between a network card and an optical module, which includes a network card information acquisition module 11, an optical module information acquisition module 22, a detection module 55, a result comparison module 66, a connection judgment module 33, and a rate judgment module 44;
the network card information acquisition module 11 is used for acquiring basic information of a network card;
the optical module state acquisition information module 22 is configured to acquire current speed and connection information of an optical module connected to the network card according to the acquired basic information;
a connection judging module 33, configured to judge whether the connection state is a connection state according to the connection information acquired by the optical module state acquisition information module; if the connection state is established, outputting information to a rate judging module;
the rate judging module 44 is configured to, if it is judged that the optical module is in a connection state, call an optical module parameter standard library file corresponding to the set threshold rate, judge whether the current rate is the set threshold rate, and if so, output information to the detecting module 55;
the detection module 55 is configured to detect the optical module and output a detection result if the current rate is a set threshold rate;
the result comparison module 66 is used for calling the optical module parameter standard library file to compare with the detection result and returning the comparison result.
In order to facilitate the calling of corresponding optical module parameter standard library files in the subsequent comparison of test results, different specifications correspond to different optical module parameter standard library files.
And acquiring the current speed and the connection information of the optical module connected with the network card, and calling the speed and the connection state of the optical module standard library file contrast detection.
The embodiment 9 of the invention also provides an automatic testing device for compatibility of the network card and the optical module, which comprises a network card information acquisition module 11, an optical module information acquisition module 22, a detection module 55, a result comparison module 66, a connection judgment module 33 and a speed judgment module 44;
the network card information acquisition module 11 is used for acquiring basic information of a network card;
the optical module state acquisition information module 22 is configured to acquire current speed and connection information of an optical module connected to the network card according to the acquired basic information;
a connection judging module 33, configured to judge whether the connection state is a connection state according to the connection information acquired by the optical module state acquisition information module; if the connection state is established, outputting information to a rate judging module;
the rate judging module 44 is configured to, if it is judged that the optical module is in a connection state, call an optical module parameter standard library file corresponding to the set threshold rate, judge whether the current rate is the set threshold rate, and if so, output information to the detecting module 55;
the detection module 55 is configured to detect the optical module and output a detection result if the current rate is a set threshold rate; the detection module 55 comprises an optical module state parameter acquisition unit, a calling unit and a parameter comparison unit; the optical module state parameter acquisition unit is used for acquiring state parameter information of the optical module; the calling unit is used for calling the optical module parameter standard library file corresponding to the set threshold rate; the standard value comprises the assignment and the range of the parameter; the parameter comparison unit is specifically used for comparing the acquired state parameter information of the optical module with assignment and range of corresponding parameters in the optical module parameter standard library file; if the value is equal to the assigned value or within the set range, outputting information; if the output information is not equal to the assigned value and is not set in the range any more, the output information is inconsistent.
The result comparison module 66 is used for calling the optical module parameter standard library file to compare with the detection result and returning the comparison result.
An electronic device provided in embodiment 10 of the present invention may include: a processor (processor), a communication interface (Communications Interface), a memory (memory) and a bus, wherein the processor, the communication interface, and the memory communicate with each other via the bus. The bus may be used for information transfer between the electronic device and the sensor. The processor may call logic instructions in memory to perform the following method: step 51: acquiring register information of an optical module; step 52: setting corresponding standard values for the acquired register information respectively to form an optical module parameter standard library file; step 53, obtaining basic information of the network card; step 54: acquiring the current speed and the connection information of the optical module connected with the network card according to the acquired basic information; step 55: judging whether the connection state is the connection state according to the connection information; if the connection state is not established, the detection is ended; if so, executing step 56; step 56: calling an optical module parameter standard library file corresponding to the set threshold rate; step 57: judging whether the current rate is a set threshold rate, if so, executing step 58; otherwise, return fail, go to step 61; step 58: acquiring state parameter information of an optical module; step 59: calling an optical module parameter standard library file corresponding to the set threshold rate; step 60: comparing the acquired state parameter information of the optical module with a standard value correspondingly established in a called optical module parameter standard library file; judging whether the set range is within the set range, if so, returning to the pass, and executing step 61; otherwise, return fail, go to step 61; step 61: and (5) ending.
Further, the logic instructions in the memory described above may be implemented in the form of software functional units and stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Although the present invention has been described in detail by way of preferred embodiments with reference to the accompanying drawings, the present invention is not limited thereto. Various equivalent modifications and substitutions may be made in the embodiments of the present invention by those skilled in the art without departing from the spirit and scope of the present invention, and it is intended that all such modifications and substitutions be within the scope of the present invention/be within the scope of the present invention as defined by the appended claims. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (6)
1. The automatic test method for the compatibility of the network card and the optical module is characterized by comprising the following steps of:
acquiring register information of an optical module;
setting corresponding standard values for the acquired register information respectively to form an optical module parameter standard library file;
acquiring basic information of a network card;
acquiring the current speed and the connection information of the optical module connected with the network card according to the acquired basic information;
judging whether the connection state is the connection state according to the connection information;
if the connection state is not established, the detection is ended;
if so, calling an optical module parameter standard library file corresponding to the set threshold rate, and judging whether the current rate is the set threshold rate or not;
if not, testing the return value fail, and ending the detection;
if yes, detecting the optical module and outputting a detection result;
and calling the optical module parameter standard library file to compare with the detection result, and returning the comparison result.
2. The automated test method for compatibility between a network card and an optical module according to claim 1, wherein the step of detecting the optical module and outputting the detection result comprises:
acquiring state parameter information of an optical module;
calling an optical module parameter standard library file corresponding to the set threshold rate;
and comparing the acquired state parameter information of the optical module with a standard value correspondingly established in a called optical module parameter standard library file, returning to a pass if the information is in a set range, and otherwise, returning to fail.
3. The automatic test method for compatibility of network card and optical module according to claim 2, wherein the standard value comprises assignment and range of parameters;
the step of comparing the acquired state parameter information of the optical module with the standard value correspondingly established in the called optical module parameter standard library file comprises the following steps:
comparing the acquired state parameter information of the optical module with assignment and range of corresponding parameters in an optical module parameter standard library file;
if the value is equal to the assigned value or within the set range, outputting information; if the output information is not equal to the assigned value and is not set in the range any more, the output information is inconsistent.
4. The automated test method of compatibility of a network card with an optical module of claim 2, further comprising:
acquiring basic information of a network card and simultaneously storing log information;
and comparing the acquired state parameter information of the optical module with assignment and range of corresponding parameters in the optical module parameter standard library file, and simultaneously storing log information.
5. The automatic testing device for compatibility of the network card and the optical module is characterized by comprising a creation module, a network card information acquisition module, an optical module information acquisition module, a connection judgment module, a speed judgment module, a detection module and a result comparison module;
the creation module is used for acquiring register information of the optical module; setting corresponding standard values for the acquired register information respectively to form an optical module parameter standard library file;
the network card information acquisition module is used for acquiring basic information of a network card;
the optical module state acquisition information module is used for acquiring the current speed and the connection information of the optical module connected with the network card according to the acquired basic information;
the connection judging module is used for judging whether the connection state is the connection state or not according to the connection information acquired by the optical module state acquisition information module; if the connection state is established, outputting information to a rate judging module;
the speed judging module is used for calling the optical module parameter standard library file corresponding to the set threshold speed if judging that the optical module is in a connection state, judging whether the current speed is the set threshold speed or not, and if so, outputting information to the detecting module;
the detection module is used for detecting the optical module and outputting a detection result if the current speed is a set threshold speed;
and the result comparison module is used for calling the optical module parameter standard library file to compare with the detection result and returning the comparison result.
6. An electronic device comprising a processor and a memory, said processor and said memory completing communication with each other via a bus; the memory stores program instructions executable by the processor, the processor invoking the program instructions to perform the network card and optical module compatibility automation test method of any of claims 1-4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110839417.7A CN113765737B (en) | 2021-07-23 | 2021-07-23 | Automatic test method and device for compatibility of network card and optical module, and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110839417.7A CN113765737B (en) | 2021-07-23 | 2021-07-23 | Automatic test method and device for compatibility of network card and optical module, and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113765737A CN113765737A (en) | 2021-12-07 |
CN113765737B true CN113765737B (en) | 2023-08-08 |
Family
ID=78787878
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110839417.7A Active CN113765737B (en) | 2021-07-23 | 2021-07-23 | Automatic test method and device for compatibility of network card and optical module, and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113765737B (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107995066A (en) * | 2017-12-19 | 2018-05-04 | 曙光信息产业股份有限公司 | A kind of method and apparatus of automatic test network interface card |
CN108255653A (en) * | 2018-01-02 | 2018-07-06 | 深圳壹账通智能科技有限公司 | The test method and its terminal of a kind of product |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103593281B (en) * | 2012-08-15 | 2016-06-15 | 纬创资通股份有限公司 | Test macro and method of testing |
-
2021
- 2021-07-23 CN CN202110839417.7A patent/CN113765737B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107995066A (en) * | 2017-12-19 | 2018-05-04 | 曙光信息产业股份有限公司 | A kind of method and apparatus of automatic test network interface card |
CN108255653A (en) * | 2018-01-02 | 2018-07-06 | 深圳壹账通智能科技有限公司 | The test method and its terminal of a kind of product |
Also Published As
Publication number | Publication date |
---|---|
CN113765737A (en) | 2021-12-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2017000424A1 (en) | Protocol detection method and apparatus | |
CN109361562B (en) | Automatic testing method based on associated network equipment access | |
CN104569891A (en) | System for testing power quality monitoring device and testing method thereof | |
CN114384892A (en) | Test equipment, state detection method and device of vehicle control unit and electronic equipment | |
CN112445490A (en) | File sequence processing method and device, terminal equipment and storage medium | |
CN109217922A (en) | A kind of method and device that optical module reports Received Loss Of Signal to alert | |
CN101344579B (en) | Battery electric quantity detection apparatus and method | |
CN110739025B (en) | Power failure test method, device and system for storage equipment | |
CN113765737B (en) | Automatic test method and device for compatibility of network card and optical module, and electronic equipment | |
CN114414255A (en) | Automatic driving test method and system based on CAN message period monitoring | |
CN112269697B (en) | Equipment storage performance testing method, system and related device | |
CN101800672A (en) | Equipment detection method and equipment | |
CN105588989A (en) | Testing method and apparatus for single board | |
CN105547643A (en) | Optical-electric module detection method | |
CN110940874B (en) | Calibration method, server and medium for nuclear power station transformer protection device | |
CN116244133A (en) | Hard disk test management method, system, terminal and storage medium | |
CN115391189A (en) | Test method for diagnosing fault codes and vehicle | |
CN114326669A (en) | Vehicle IO test method and device, electronic equipment and storage medium | |
CN113434411A (en) | TIAS function test method and system | |
CN112415368A (en) | Circuit board detection method and device, electronic equipment and readable storage medium | |
CN112242858B (en) | Method and device for testing carrier communication module of electric energy meter | |
CN114025152B (en) | Method for testing on-off pressure of abnormal power failure in starting process of intelligent television | |
CN114543862A (en) | Grating sensor quality detection system | |
CN114006822B (en) | Method and device for judging link between switch and server | |
CN113010388B (en) | USB flash disk detection method and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |