External Tests from DMM – SATA Self Test
The ability to call any external program as a test step from within a DMM test sequence allows any new type of test to be added to the DMM test pallet. By using the Developers Toolbox (DTB) api you can send any command to any type of device.
This example will illustrate how to run a SATA SMART Self Test as a DMM test step, logging the results to the DMM device log file.
A C++ program to execute the SATA Self Test
Using Microsoft Visual Studio C++ and the STB Suite Developers Toolbox api we can send any command we need to any type of device. Since DMM is communicating with SATA devices via a SAS controller which implements SAT (SCSI->ATA Translation) such as the LSI 3800 or 3801 we must write our program to issue the SATA command imbedded into a SCSI command, according to the SAT standard.
For this test we will run the default short SATA Self Test.
To illustrate how easy it is to add a new test like this to DMM you will note that the sample source code is well under 200 lines.
Our example project retrieves the address of the drive from the command line arguments passed by DMM. In addition DMM allows you to pass additional user defined command line arguments to your program. For example, you could modify this project to allow you to specify any of the different SATA Self Tests.
DMM can also receive information passed back to it by the called external program. In the case of this example we will respond back to DMM with a text message saying whether the self test executed correctly or not. DMM runs the external programs as separate threads on each device under test, and so each separate device will get back only its own response string.
The code to issue the self test command using the DTB User Defined SCSI command simply defines the proper command and issues it with one DTB function call as follows:
This quick example illustrates how simply and quickly completely new tests can be added to the DMM test pallet. From simple commands like this example uses, through highly complex tests, any new function is easily added to DMM via the DMM External Test test step.
To request the complete Visual Studio project files for this example please contact Jeremy Wolfe at firstname.lastname@example.org.