Command compliance testing is an important engineering step in designing new storage devices. It is also important to storage integration companies for comparing drives from different vendors or for checking operability of different firmware revisions or other changes. Testing command compliance can have both a positive and a negative test approach. You need to test that legal commands are processed correctly, and you may need to test that illegal commands fail correctly. Both of these methods can be tested using the STB Suite, using either the stand-alone SCSI and SATA command compliance applications, or also by using the techniques outlined in this article to use the built-in CDB and SATA Command Sequencer features.
Using the CDB or Command Sequencer
A built-in feature of the STB Suite is the SCSI CDB Sequencer and the SATA Command Sequencer. Both features work in the exact same way to issue any SCSI or SATA command to any type of device. The commands are defined in text files which are easy to add to and edit. Both features produce the same type of output log, and both are very easy to use.
A SCSI example
For this example we will use the SCSI CDB Sequencer to do command compliance testing of a disk drive.
The first step is to create a command file with the disk commands which you want to test. You may want to create one command file with non-destructive commands and a different file with destructive commands – such as WRITE and FORMAT commands. Likewise you can create separate command files for destructive and non-destructive testing of tape drives.
The command files used by the CDB sequencer consist of entries for each command, such as:
The first field is the name of the command,
followed by the CDB length (6,10,12,0r 16 bytes),
followed by the data direction (1=in, 0=out),
followed by the data length in hexadecimal,
followed by the bytes of the CDB, also in hexadecimal.
As simple example of a non-destructive command test file will include the commands
TEST UNIT READY
EXTENDED READ (10-byte)
And looks like this:
Test Unit Ready,6,1,00,00,00,00,00,00,00
Running the example
Select a SCSI Disk drive in the device menu, then start the SCSI CDB Sequencer by going to the top menu
Scripts and Sequences->SCSI CDB Sequencer choice. The last used command file will be named and you will be asked if that is the file you wish to use. In this case we will answer No and will browse to our non-destructive command file which we created above.
The SCSI CDB Sequencer dialog will be displayed –
And clicking on the View CDBs button will show our commands –
The first time the command compliance is run you need to execute each CDB manually, by specifying the CDB in the Command Entry window and then clicking the Execute button. This will execute the command and will also make an entry in the Command History window, which we will use to save and replay the compliance test sequence.
The easiest way to accomplish this is while the Available Commands box is displayed (from clicking theView CDBs button), just double-click on each command in the Available Commands window, bring that command into the Command Entry window. Then click Execute.
Do this for all four commands. You will now have all four commands in your Command History window, as shown here:
Now click the Save to File button and save the command history for later replay.
To replay the same test –
Select your drive and start the SCSI CDB Sequencer, again specifying your test command file. Now use the Load from File button to load your saved history (.his) file from above. Now use click and Shift-Click to select all the commands in the history window as shown here –
Now click the Execute button and all of the commands will be issued in order, with the results shown in the Commands Results window as shown here –
Use the Command Results Save to File button to save the results of each command to a log file.
Now expand your command definition file to include every command which you want to test. If you want to test illegal commands simply make an entry in your command description file which is invalid. As a quick example we will issue an illegal INQUIRY command to show the results of an illegal command –
Also – note that the CDB Sequencer lets you specify how many data bytes will be recorded to the Command Results window – the default is 8 bytes. If you need to capture more data than 8 bytes simply specify it before running the test.
Using the STB Suite CDB or ATA Command Sequencers makes command compliance testing quick and easy. You can test any device type on any interface. Keep your previous command files for regression testing, and add new or vendor-unique commands as you need for testing new device functionality.
This example used the SCSI CDB sequencer. SATA Command compliance is accomplished the exact same way but using a SATA drive connected to a native SATA motherboard port, and using the SATA Command Sequencer run from the ATA/SATA->ATA Command Sequencer menu choice.
SATA disk drives maintain a number of different logs, documenting various device performance information, error information, and the results of previously run self tests. This article will focus on the SATA Extended SMART Self-Test logs.
Where to find information
Documentation on SATA drives in general can be found at the www.T13.org web site. The particular document that will be referenced in this article is T13/1699-D AT Attachment 8 –ATA/ATAPI Command SET (ATA8-ACS)
Viewing Logs with the STB Suite
There are two methods of retrieving and viewing the Extended SMART Self-Test Logs using the STB Suite – the method you use will depend upon how your SATA drive is connected to your test system.
Direct Motherboard SATA port connection –
When a SATA drive is connected to your test system through one of the system motherboard SATA ports you will use the STB Original mode, top-menu ATA/SATA->Commands->View SMART Self-Test Logs function. This will open a dialog where you will select your SATA drive from the list of drives shown in the Devices window on the right of the dialog. Simply click on the drive you are interested in and the logs will be displayed as follows:
The drive-specific information such as the model number and drive serial number are displayed, then the number of logs which the drive contains is shown. In our example case this drive has two log entries. Next shown are the individual log entries and their details.
Extended Log Data
-Content of the LBA Field – this byte tells what type of self test was run – the STB Suite interprets this below this line.
-Self Test Execution Byte – this byte shows the final status of the self test, the interpretation of this byte is taken from the following table:
Again the STB Suite prints the interpretation of this byte on the next line in the results log.
-Life Timestamp(s) these two bytes display the power-on hours when this self test was completed.
-Selftest Failure Checkpoint Byte – this byte may contain additional information if the self test failed. Check the documentation from your drive vendor for your particular drive for definitions.
– Failing LBA – the LBA of the logical sector that caused the test to fail. If the test passed then this field is undefined.
Click the Save Results to File button to save the contents of the test results to a text file.
SATA Drives connected to SAS HBA port connection –
In order to test multiple SATA drives, including executing SMART Self Tests and retrieving SMART Self Test logs you will use the STB Suite Disk Manufacturing Module (DMM).
The required test system hardware configuration for testing SAS/SATA drives using DMM is a SAT-compliant SAS host bus adapter – we recommend the LSI 3800X or LSI 3801e cards. These are four-port cards which you need to connect to drive enclosures which include expanders. Dell and Promise manufacture such enclosures, contact email@example.com for details on where to purchase this hardware.
Retrieving and logging SMART Self Test logs is accomplished by adding the SATA Info test step to your test sequence. This test will retrieve the SATA IDENTIFY, and SMART self test log data and interpret and log it to your log file(s).
Here is an example of the self test log data logged:
The SATA Extended SMART Self Test logs can provide valuable information to help you determine the overall health of your disk drive.
If your drives self test log is empty, or if you simply want to run a self test at any time simply use the STB Suite ATA/SATA->Tests->Excute SMART Self Test function. The use of this function is described in the STB white paper “Executing SATA SMART Self Tests” available by contacting firstname.lastname@example.org
Customized training with an STB technician
Do you have questions about how to best use the STB Suite in your business? STB is happy to work with you in an interactive “live” environment to help you get the most out of your Toolbox. The cost? If you are a current Performa customer it is free! The commitment? Training sessions run between 30 and 60 minutes.
Here is a list of some recent customer training sessions that STB has conducted – live, interactive web sessions presented by STB programmers:
- Three stages of disk drive screening
- How to troubleshoot tape drive problems
- RAID issues in disk drive testing
- Multi-drive SATA firmware downloading with the STB Suite
Contact Jeremy Wolfe at (480) 600-9595 today to schedule your own custom training session!
Ask Dr. SCSI – “Can the STB Suite do a quick format?”
Q. “I know in SCSI Toolbox, you can do a format on a drive(s), but is there an option to do a quick format?”
A. “A quick format is usually just erasing the OS FAT (File Allocation Table) from a drive. Which gets rid of the file system pointers to any user data on the drive, but does not actually remove the data itself. Which is why it not a secure thing to do if you are worried about that old data.
But if you don’t care about the data and just want to have the drive appear empty to an OS you can usually just erase the first bunch of blocks on the drive by doing a sequential write test for a few seconds.
The primary FAT of most OS’s lives in the first several blocks of the drive. Some OS’s keep backup or spare FATs spread around the disk, but from my experience overwriting the first couple of thousand blocks of a drive will make it appear blank.”
Performa for STB Suite
Thinking about upgrading your old STB Suite licenses? Now is the time! With your STB Suite Performa coverage you’re qualifed to receive:
- Latest CD of the SCSItoolbox (Version 8.1.0) shipped for use with your existing STB Hardware key license
- Access to all product updates (Emailed Quarterly to the Technical Contact)* for one year from purchase date
- New tests, new interface support, new commands, major upgrade or incremental change
- GoToMeeting™ training session tailored for your business needs
- Access to technical support and engineering staff via email@example.com
- Monday through Friday 8AM – 5PM Mountain Standard Time
- Response time guaranteed within 24 hours (Typical response time 4 hours or less)
- 8 hours of technical support
- Products included with upgrade:
You can purchase your upgrades online: http://www.stbsuite.com/buy/ and save 5%, or call Jeremy in sales to get a customized quote.