Introduction
There are times when doing device command compliance that you may wish to go beyond just seeing if a device executes a command without a check condition. In this article we will discuss one way to compare the data being returned by the devices under test.
In this example we will be comparing the sense data of two different drives. Of course the same approach can be used to compare write/read data, log page data, inquiry data, etc.
We will use the STB Suite Original-mode User-Defined CDB function, and will show how to use BAMto confirm proper CDB execution.
Collecting the data
Follow these steps to collect the data from your devices:
- First run STB in original mode.
- Select your drive to test in the device menu,
- and also start BAM and select the same device.
- Start the BAM capture.
- In STB, right-click on the device to test and choose User Defined CDB’s from the quick command menu.
- Clear the data buffer by clicking Buffers and setting all bytes to zero
- Define your CDB (in our case a MODE SENSE – ALL PAGES) and issue it
- Save the data by going to Buffers->File Operations->Save to file. We will save the buffer data in the same format that it is displayed, that is as ASCII text and with the buffer addresses shown. This will make the data compare operation much easier.
- At this point you can stop the BAM capture and view the CDB and response as a quick check to be sure that everything went as you planned
Repeat the above process for each device you want to compare. For this example we will collect the Mode Page data from one drive, then change a few settings in the Mode Pages, then re-collect the data for comparison.
Comparing the data
For comparing two files we recommend the open-source tool WinMerge (http://winmerge.org/)
Simply specify your first data file for the right side, and your second data file for the left. Any and all differences will be highlighted, and with the buffer address shown you can consult your SCSI command documentation to determine exactly which bits of which bytes of which mode pages are different between the two devices.
Simple! In this example we can see that byte 2 of mode page 8 is different.
Summary
The STB Suite makes issuing CDB’s and grabbing responses and data a breeze, and Winmerge makes finding and spotting the differences a simple and quick task.