CN104636223A - Test system and method for locating SAS channel - Google Patents

Test system and method for locating SAS channel Download PDF

Info

Publication number
CN104636223A
CN104636223A CN201310563143.9A CN201310563143A CN104636223A CN 104636223 A CN104636223 A CN 104636223A CN 201310563143 A CN201310563143 A CN 201310563143A CN 104636223 A CN104636223 A CN 104636223A
Authority
CN
China
Prior art keywords
hard disk
sas
sas hard
measured
read
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201310563143.9A
Other languages
Chinese (zh)
Inventor
林军嘉
封运华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hongfujin Precision Industry Shenzhen Co Ltd
Hon Hai Precision Industry Co Ltd
Original Assignee
Hongfujin Precision Industry Shenzhen Co Ltd
Hon Hai Precision Industry Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hongfujin Precision Industry Shenzhen Co Ltd, Hon Hai Precision Industry Co Ltd filed Critical Hongfujin Precision Industry Shenzhen Co Ltd
Priority to CN201310563143.9A priority Critical patent/CN104636223A/en
Publication of CN104636223A publication Critical patent/CN104636223A/en
Pending legal-status Critical Current

Links

Abstract

A test system for locating an SAS channel runs in a computer host, the host comprises a memorizer, a processor, a to-be-tested mainboard and an SAS disk controller, the SAS disk controller is connected with a to-be-tested SAS hard disk, and the host is connected to a display device. According to the test system for locating the SAS channel, when an equipment file corresponding to a node name cannot be opened in an operating system, or after the equipment file is opened, read-write operation of the current to-be-tested SAS hard disk fails, or written preset data and read data are compared to be inconsistent, the serial number of the node name is displayed directly, and an operator can replace the SAS hard disk with a problem. The invention further provides a test method for locating the SAS channel. According to the system and method, test time can be saved, and test efficiency can be improved.

Description

The test macro of location SAS passage and method
Technical field
The present invention relates to a kind of channel test system and method, particularly about a kind of test macro and method of locating SAS passage.
Background technology
At present in the server master board test of factory, be carry out testing SA S hard disk by read-write SAS hard disk (serial attached SCSI, serial connecting small computer system interface) or the method for similar devices.Conventional method of testing, such as, test procedure in linux system is by judging whether '/dev/sgX ' node is SAS hard disk, then test procedure is by SCSI(small computer system interface, small computer system interface) order and remove read-write SAS hard disk, then judge whether data mate.When the following two kinds mistake appears in passage, one is cannot opened nodes number corresponding device file in linux system, two be read-write operation failure or read and write data comparison mistake time, the disposal route adopted has two kinds, the first is the sequence number SN (Serial Number) that test procedure reads other normal SAS hard disk, then gone to check in turn by operator, find out the SAS hard disk not having to show, the second is the SN that test procedure can attempt to read the SAS hard disk occurring mistake, if success, shows wrong SAS hard disk, if unsuccessful, continue to use first method.Said method all needs operator at substantial energy to go comparison SN just can orient problematic SAS hard disk or SAS passage.
Summary of the invention
In view of above content, be necessary to provide a kind of test macro of locating SAS passage, by the numbering that the node number that directly shows SAS hard disk is corresponding, operator swapped out problematic SAS hard disk.
In addition, there is a need to provide a kind of method of testing of locating SAS passage.
A kind of test macro of locating SAS passage, be applied in computing machine, this system comprises: module preserved by SN table, for when SAS hard disk is as measurement jig by the gross, deposit in assigned catalogue by the SN of this batch of SAS hard disk table, described SN table stores the sequence number SN of each SAS hard disk and corresponding numbering; Calling driver module, call SG driving for triggering SAS driving, described SG drives as this batch of each SAS hard disk Resources allocation; Name module, for the maximum node number that search operation system has been distributed, described maximum node number being added one as the node number X of current SAS hard disk to be measured, is the peer distribution first node name of described current SAS hard disk to be measured; Read module, for reading the SN of described current SAS hard disk to be measured from the SN table in described assigned catalogue, and finding out this SN numbering Y corresponding in described SN table, is the peer distribution Section Point name of described current SAS hard disk to be measured again; Writing module, during for can open the device file of node corresponding to described Section Point name when test procedure, sending scsi command is SAS hard disk current to be measured write preset data corresponding to described name, then sends scsi command and read described data from this current SAS hard disk to be measured; Judge module, for judging that whether read-write operation is successful and whether preset data that is comparison write is consistent with the data of reading; Display module, for can not open the device file of node corresponding to described Section Point name when test procedure, or read-write operation is unsuccessful, or when comparison data is inconsistent, directly shows numbering Y.
Locate a method of testing for SAS passage, be applied in computing machine, the method comprises the steps:
Preserve SN and show step, deposit in assigned catalogue using the SN of a collection of SAS hard disk as measurement jig table, described SN table stores the sequence number SN of each SAS hard disk and corresponding numbering; Call actuation step, trigger SAS driving and call SG driving, SG drives as this batch of each SAS hard disk Resources allocation; Name step, the maximum node number that search operation system has been distributed, described maximum node number being added one as the node number X of current SAS hard disk to be measured, is the peer distribution first node name of described current SAS hard disk to be measured; Read step, reads the SN of described current SAS hard disk to be measured from the SN table described assigned catalogue, and finds out this SN numbering Y corresponding in described SN table, is the peer distribution Section Point name of described current SAS hard disk to be measured again; Write step, when test procedure can open the device file of node corresponding to described Section Point name, sending scsi command is SAS hard disk current to be measured write preset data corresponding to described name, then sends scsi command and read described data from this current SAS hard disk to be measured; Comparison step, when read-write operation success, whether the preset data of comparison write is consistent with the data of reading; Step display, when test procedure can not open the device file of node corresponding to described Section Point name, or read-write operation is unsuccessful, or when comparison data is inconsistent, directly shows numbering Y; Repeat step, getting next SAS hard disk to be measured as current SAS hard disk to be measured, then repeating above-mentioned name step to repeating step, until this batch of SAS hard disk is all completed.
Compared to prior art, the test macro of location provided by the invention SAS passage and method, be no matter on an operating system cannot opened nodes number corresponding device file time, or after opening described device file, but SAS hard disk to be measured occur read-write operation failure, or the preset data of comparison said write and the data of reading inconsistent time, by directly showing numbering corresponding to described node number, operator is swapped out problematic SAS hard disk, saves the test duration, improve testing efficiency.
Accompanying drawing explanation
Fig. 1 is the running environment schematic diagram that the present invention locates the test macro preferred embodiment of SAS passage.
Fig. 2 is the functional block diagram that the present invention locates the test macro preferred embodiment of SAS passage.
Fig. 3 is the process flow diagram that the present invention locates the method for testing preferred embodiment of SAS passage.
Main element symbol description
Main frame 1
Display device 2
The test macro of location SAS passage 10
Storer 20
Processor 30
Mainboard to be measured 40
SAS Magnetic Disk Controller 400
SAS hard disk 401—404
SN shows creation module 100
Module preserved by SN table 101
Calling driver module 102
Name module 103
Read module 104
Writing module 105
Judge module 106
Display module 107
Following embodiment will further illustrate the present invention in conjunction with above-mentioned accompanying drawing.
Embodiment
As shown in Figure 1, be the running environment schematic diagram that the present invention locates the test macro preferred embodiment of SAS passage.
In this preferred embodiment, the test macro 10 of location SAS passage runs in main frame 1, and this main frame 1 is connected with display device 2, and this main frame 1 also comprises storer 20, processor 30 and mainboard to be measured 40.Described storer 20 for storing the data such as the program code of the test macro 10 of described location SAS passage, described processor 30 for performing each functional module of the test macro 10 of described location SAS passage, to complete the present invention.Described mainboard to be measured 40 comprises again SAS Magnetic Disk Controller 400, and current most of Magnetic Disk Controller can connect 8 SAS hard disks, also has 4,16 or 32.In the present embodiment, described SAS Magnetic Disk Controller 400 connects 4 SAS hard disks 401 ~ 404.Described display device 2 is for providing graphic user interface (Graphic User Interface, GUI), and the test result according to the test macro 10 of location SAS passage shows accordingly.
As shown in Figure 2, be the high-level schematic functional block diagram that the present invention locates the test macro 10 of SAS passage.In the present embodiment, the test macro 10 of described location SAS passage comprises SN table creation module 100, SN table preservation module 101, calling driver module 102, name module 103, read module 104, writing module 105, judge module 106 and display module 107.Module alleged by the present invention has been the program segment of specific function, is more suitable for describing software implementation in a processor 30 than program.Therefore below the present invention, software is all described by module.Be described in detail in the process flow diagram of Fig. 3 about each functional module 100-107.
Shown in figure 3, it is the process flow diagram that the present invention locates the method for testing preferred embodiment of SAS passage.
Step S01, preserves SN table.SN table is preserved module 101 and is deposited in assigned catalogue using the SN of a collection of SAS hard disk as measurement jig table, and described SN table stores the sequence number SN of each SAS hard disk and corresponding numbering.
If this batch of SAS hard disk first time as measurement jig, then also comprised the step that creates SN table before preserving SN table.First, SN shows creation module 100 is that this batch of SAS hard disk creates SN table.Each hard disk has individual sequence number SN (Serial Number), is the unique sign of hard disk.First this batch of SAS hard disk is sorted according to SN, again this batch of SAS hard disk is received on mainboard 40 to be measured in certain direction according to SN order from small to large, then start the operating system, drive and SAS driving for server mainboard 40 to be measured loads SG, in the present embodiment, this operating system is linux system.SN shows the SN that creation module 100 reads this batch of SAS hard disk, and according to sorting from small to large, then give each SAS hard disk one numbering, then the SN of this batch of SAS hard disk after numbering is preserved into a SN table, this SN table is uploaded to the assigned catalogue of given server.In the present embodiment, the file layout of SN table is:
Step S02, calling driver module 102 triggers SAS driving and calls SG driving, and SG drives as each SAS hard disk Resources allocation, and the resource of described distribution shows each SAS hard disk storage allocation, device node etc.
Step S03, the maximum node number of having distributed in name module 103 search operation system, adds one as the node number of current SAS hard disk to be measured using this maximum node number.
Step S04, name module 103 is peer distribution first node name of described current SAS hard disk to be measured.As '/dev/sgX ', X is the node number of described current SAS hard disk to be measured.
Step S05, whether read module 104 is searched the SN table creating assigned catalogue in SN table step and is existed.
When there is described SN and showing, perform step S06, described read module 104 reads the SN of described current SAS hard disk to be measured, and finds out this SN numbering corresponding in described SN table, is peer distribution Section Point name of described current SAS hard disk to be measured again.As '/dev/sgY ', Y is the numbering that described current SAS hard disk to be measured is corresponding in SN table.
When there is not described SN and showing, terminate this flow process.
Step S07, writing module 105 detects the device file whether being opened described Section Point name corresponding node by test procedure.
When said write module 105 can not open the device file of described Section Point name corresponding node by test procedure, perform step S08, when described device file can be opened, perform step S09.
Step S08, display module 107 directly shows numbering Y, and operator directly finds the SAS hard disk of makeing mistakes by described numbering, then enter step S13.
Step S09, after opening described device file, it is SAS hard disk current to be measured write preset data corresponding to described name that writing module 105 sends scsi command, then sends scsi command and read described data from this current SAS hard disk to be measured.
Step S10, judge module 106 judges that whether read-write operation is successful.
When read-write operation success, perform step S11, when read-write operation failure, perform step S08.
Step S11, whether the preset data of judge module 106 comparison write is consistent with the data of reading.When the preset data of said write and the data of reading inconsistent time, perform step S08, when the data consistent of preset data and the reading of said write, execution step S12.
Step S12, display module 107 prompting is tested successfully, and enters step S13.
Step S13, judge module 106 judges whether that SAS hard disk test is complete by the gross.
When SAS hard disk test is complete by the gross, then terminate.Otherwise, enter step S14.
Step S14, takes out next one SAS to be measured hard disk in this batch of SAS hard disk as current SAS hard disk to be measured, then returns step S03.
It should be noted last that, above embodiment is only in order to illustrate technical scheme of the present invention and unrestricted, although with reference to preferred embodiment to invention has been detailed description, those of ordinary skill in the art is to be understood that, can modify to technical scheme of the present invention or equivalent replacement, and not depart from the spirit and scope of technical solution of the present invention.

Claims (8)

1. locate a method of testing for SAS passage, be applied in computing machine, it is characterized in that, the method comprises the steps:
Preserve SN and show step, deposit in assigned catalogue using the SN of a collection of SAS hard disk as measurement jig table, described SN table stores the sequence number SN of each SAS hard disk and corresponding numbering;
Call actuation step, trigger SAS driving and call SG driving, SG drives as this batch of each SAS hard disk Resources allocation;
Name step, the maximum node number that search operation system has been distributed, described maximum node number being added one as the node number X of current SAS hard disk to be measured, is the peer distribution first node name of described current SAS hard disk to be measured;
Read step, reads the SN of described current SAS hard disk to be measured from the SN table described assigned catalogue, and finds out this SN numbering Y corresponding in described SN table, is the peer distribution Section Point name of described current SAS hard disk to be measured again;
Write step, when test procedure can open the device file of node corresponding to described Section Point name, sending scsi command is SAS hard disk current to be measured write preset data corresponding to described name, then sends scsi command and read described data from this current SAS hard disk to be measured;
Comparison step, when read-write operation success, whether the preset data of comparison write is consistent with the data of reading;
Step display, when test procedure can not open the device file of node corresponding to described Section Point name, or read-write operation is unsuccessful, or when comparison data is inconsistent, directly shows numbering Y;
Repeat step, getting next SAS hard disk to be measured as current SAS hard disk to be measured, then repeating above-mentioned name step to repeating step, until this batch of SAS hard disk is all completed.
2. the method for testing of location as claimed in claim 1 SAS passage, it is characterized in that, described step display also comprises:
When read-write operation success, and during the data consistent of the preset data of comparison write and reading, prompting is tested successfully.
3. the method for testing of location as claimed in claim 1 SAS passage, it is characterized in that, described read step also comprises, and when there is not SN table in assigned catalogue, terminates this flow process.
4. method of testing of locating SAS passage as claimed in claim 1, is characterized in that, if this batch of SAS hard disk is for the first time as measurement jig, then also comprises before preservation SN shows step and creates SN table step:
This batch of SAS hard disk is sorted according to SN, then this batch of SAS hard disk is received on mainboard to be measured according to SN order from small to large in certain direction;
Start the operating system, drive and SAS driving for described mainboard to be measured loads SG;
Read the SN of this batch of SAS hard disk, and according to sorting from small to large, then give each SAS hard disk one numbering;
The SN of this batch of SAS hard disk of numbering is preserved into a SN table.
5. locate a test macro for SAS passage, be applied in computing machine, it is characterized in that, this system comprises:
Module preserved by SN table, deposits in assigned catalogue using the SN of a collection of SAS hard disk as measurement jig table, and described SN table stores the sequence number SN of each SAS hard disk and corresponding numbering;
Calling driver module, call SG driving for triggering SAS driving, described SG drives as this batch of each SAS hard disk Resources allocation;
Name module, for the maximum node number that search operation system has been distributed, described maximum node number being added one as the node number X of current SAS hard disk to be measured, is the peer distribution first node name of described current SAS hard disk to be measured;
Read module, for reading the SN of described current SAS hard disk to be measured from the SN table in described assigned catalogue, and finding out this SN numbering Y corresponding in described SN table, is the peer distribution Section Point name of described current SAS hard disk to be measured again;
Writing module, during for can open the device file of node corresponding to described Section Point name when test procedure, sending scsi command is SAS hard disk current to be measured write preset data corresponding to described name, then sends scsi command and read described data from this current SAS hard disk to be measured;
Judge module, for judging that whether read-write operation is successful and whether preset data that is comparison write is consistent with the data of reading;
Display module, for can not open the device file of node corresponding to described Section Point name when test procedure, or read-write operation is unsuccessful, or when comparison data is inconsistent, directly shows numbering Y.
6. the test macro of location as claimed in claim 5 SAS passage, is characterized in that, described display module also for, when read-write operation success, and during the data consistent of the preset data of comparison write with reading, point out and test successfully.
7. the test macro of location as claimed in claim 5 SAS passage, it is characterized in that, described judge module is also for judging whether SAS hard disk is completed by the gross.
8. the test macro of location as claimed in claim 5 SAS passage, is characterized in that, this system also comprises SN and shows creation module, for when the described hard disk of SAS is by the gross for the first time as measurement jig, is that this batch of SAS hard disk creates SN table, specifically comprises:
This batch of SAS hard disk is sorted according to SN, then this batch of SAS hard disk is received on mainboard to be measured according to SN order from small to large in certain direction;
Start the operating system, drive and SAS driving for described mainboard to be measured loads SG;
Read the SN of this batch of SAS hard disk, and according to sorting from small to large, then give each SAS hard disk one numbering;
The SN of this batch of SAS hard disk of numbering is preserved into a SN table.
CN201310563143.9A 2013-11-14 2013-11-14 Test system and method for locating SAS channel Pending CN104636223A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310563143.9A CN104636223A (en) 2013-11-14 2013-11-14 Test system and method for locating SAS channel

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310563143.9A CN104636223A (en) 2013-11-14 2013-11-14 Test system and method for locating SAS channel

Publications (1)

Publication Number Publication Date
CN104636223A true CN104636223A (en) 2015-05-20

Family

ID=53215010

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310563143.9A Pending CN104636223A (en) 2013-11-14 2013-11-14 Test system and method for locating SAS channel

Country Status (1)

Country Link
CN (1) CN104636223A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105094702A (en) * 2015-07-23 2015-11-25 浪潮电子信息产业股份有限公司 Server and data storage method
CN105824730A (en) * 2016-03-16 2016-08-03 北京珠穆朗玛移动通信有限公司 Method and device for diagnosing and repairing hardware
CN106201795A (en) * 2016-07-07 2016-12-07 浪潮电子信息产业股份有限公司 A kind of method of quick detection data storage link stability
CN110718263A (en) * 2019-09-09 2020-01-21 无锡江南计算技术研究所 Efficient sectional test system and method for chip access path

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105094702A (en) * 2015-07-23 2015-11-25 浪潮电子信息产业股份有限公司 Server and data storage method
CN105824730A (en) * 2016-03-16 2016-08-03 北京珠穆朗玛移动通信有限公司 Method and device for diagnosing and repairing hardware
CN106201795A (en) * 2016-07-07 2016-12-07 浪潮电子信息产业股份有限公司 A kind of method of quick detection data storage link stability
CN110718263A (en) * 2019-09-09 2020-01-21 无锡江南计算技术研究所 Efficient sectional test system and method for chip access path

Similar Documents

Publication Publication Date Title
CN102736978B (en) A kind of method and device detecting the installment state of application program
CN103150231B (en) The method of computer booting and computer system
CN103458086B (en) A kind of smart mobile phone and fault detection method thereof
CN104391765A (en) Method for automatically diagnosing boot failure of server
CN104636223A (en) Test system and method for locating SAS channel
CN101308471B (en) Method and device for data restoration
CN107402789A (en) A kind of server cluster automatic batch penetrates the method that RAID card refreshes hard disk FW
CN107453960A (en) A kind of methods, devices and systems that test data is handled in service testing
CN103391222A (en) System and method for monitoring web service
CN102467935A (en) Magnetic disk positioning system and method
CN107329914A (en) It is a kind of that the out of order method and device of hard disk is detected based on linux system
CN103559098B (en) Smart card test number control, Apparatus and system
CN107315661B (en) Deleted file recovery method and device for cluster file system
CN106294387A (en) Data migration method and device
CN106991042A (en) A kind of memory overflow localization method of Web applications
WO2016165461A1 (en) Automated testing method and apparatus for network management system software of telecommunications network
CN101963931A (en) Hard disk testing method under extensible firmware interface
CN117421217A (en) Automatic software function test method, system, terminal and medium
CN110727585B (en) Memory leak detection method, device, electronic equipment and readable storage medium
CN108459960A (en) Method of automatic configuration, device, equipment and the storage medium of test environment
CN108459925A (en) The restorative procedure of private clound equipment and its database, the device with store function
CN112596750B (en) Application testing method and device, electronic equipment and computer readable storage medium
CN103699418A (en) Method and device of retrieving external SD cards
CN107423207A (en) System compatibility automated testing method and device
CN104932958B (en) Computer card class equipment interface function automatic detection method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20150520