A SCSI Test Tool for Linux
A few months ago my ex-boss and I were discussing the latest product of his company and the systems they were using for testing purposes, both in the office and in the factory. “It's all DOS—what you want is cheap,” he told me. I believe that statement summarizes the reason DOS became the operating system of choice for factories and many laboratories. A fully equipped SCSI DOS system needs little memory, a cheap video card and monitor and a relatively cheap SCSI controller. Of course, these days there are many other reasons for using DOS for testing SCSI peripheral devices. There is a vast knowledge base, availability of ASPI-based tools and, most likely, the company already has a hefty investment in test software or in developing its own tests. (ASPI stands for Advanced SCSI Protocol Interface and was developed by Adaptec. It is the de facto SCSI programming interface on DOS and Windows.) Nevertheless, Linux is also a viable SCSI test system, and there are some very good reasons why you should consider Linux for testing your SCSI devices.
Testing a SCSI sequential access device is not a simple matter. These devices (DDS and AIT tape drives, to be specific) are usually used in a server environment where system downtime is not acceptable, especially when the down-time is due to the data backup device hanging the SCSI bus. (DDS, digital data storage, is Sony's 4mm tape drive technology. AIT, advanced intelligent tape, is Sony's new 8mm tape drive technology.) To put such a product on the market, extensive testing needs to be done in quite a few areas. Currently, the testing is performed on PCs running Sony internal tests or Independent Software Vendor (ISV) backup software or OEM proprietary systems running a flavor of UNIX, NT or some other proprietary OS. The qualification cycle of these devices is much longer than that of hard disks, but so is the life cycle of the product. The more systems you can test on and the more types of tests you can run, the more solid your product will be.
Some portions of the SCSI protocol cannot be tested without using a specialized tool, such as an Itech SCSI emulator. This type of tool allows the engineer to develop powerful low-level SCSI tests to test the SCSI protocol handling. For example, with such a tool you might issue a write command, send one or more bytes to the drive, raise ATN (attention control signal) and then, when the drive goes to output data, send an abort or reset message. These tools, however, are quite expensive (in excess of $5000 US) and certainly not all engineers need them, since not all firmware engineers work on the SCSI protocol. By the time the product makes its way to the test lab, most SCSI protocol problems are solved so the lab needs only one of those specialized testers, mainly for use in firmware regression testing.
Yet, with all of the specialized tests we have, some of our most important testing is done on commercial UNIX systems, surprisingly enough with well-written C shell scripts using standard UNIX utilities such as dd, tar and mt. My guess would be that at least half of the firmware problems in the past have been found running these scripts on UNIX systems. Linux has all those utilities, as well as a selection of shells. The same shell scripts running on commercial UNIX systems can easily be ported to Linux, maintaining the same functionality. This means you can supplement the expensive commercial UNIX systems in your lab with a few low-cost PCs running Linux. This alone makes Linux a serious contender in the SCSI testing field.
Walk into a lab where SCSI devices are being tested, and attached to the PCs on a single SCSI bus, you'll usually see a few devices. It's certainly important to test more than one device at a time; however, it rarely makes sense to have more than three or four devices running under the same test. Even if you fully populate the SCSI bus, if one device hangs overnight it sometimes hangs the SCSI bus, not allowing the rest of the devices to continue. It makes no difference, in this case, that you have six other devices attached. What would be better is to attach a second or even third SCSI controller and run different types of tests on each one. That way you can utilize the system more efficiently and thereby get more done in the same amount of time. Furthermore, if one test finds a firmware bug and the bus hangs, the other tests can continue. DOS, however, is not a multitasking operating system, and if you wish to run different tests on each SCSI controller, you'll have to add all that complexity to your test. Well, it's really no wonder I've never seen that done. It's tough enough debugging complex SCSI tests, not knowing whether the failure was due to the test or the device. Adding additional complexity to the test will most certainly take away from the firmware engineer's time who will have to debug what may turn out to be a test problem, not a drive firmware problem. Linux, on the other hand, does not suffer from this limitation. You can write basic tests, add them to your shell script and let the operating system worry about the multitasking. If one test fails because of a hung device, the other tests can continue running.
The standard UNIX utilities provide a high level of functionality testing, but, to complete a test suite, the engineer needs finer control of the SCSI device. The ability to send any SCSI command, including commands with illegal bits set, as well as illegal commands, is a must. This is one area where standard UNIX utilities cannot do the job and an alternative method is needed. Some time ago, I decided it would be nice to have a library of SCSI commands that made it easy to write tests, as well as to expand the library itself. So I started playing with the Linux generic SCSI driver, which seemed the easiest way to go, and I recently released such a library under the GPL. libdat.a contains just about all the sequential-access SCSI commands and, if there is something else you need, adding new commands is quite trivial. The library is packaged with a tape tool called stt, SCSI Tape Utility, which is based on libdat.a. stt adds a powerful capability to my Linux workstation at the office. I can now interactively send any command to the tape drives, as well as reprogram drives and make reprogramming firmware tapes. (These last two features are removed from the GPL version.) It is also an example of how easy it is to write SCSI tests using libdat.a and the generic driver in general. Most importantly, I now find it easier to write tests for my Linux workstation than for proprietary tools. Here's an example of a short C program (the #includes are not shown):
_Inquiry(); /* show device information */ _Space(EOD,0); /* space to End Of Data */ _ReadPosition(); /* show current logical * position */ _Space(FMK, -2); /* space reverse 2 filemarks */
While the above program doesn't do much, it does show the ease with which the programmer can write tests. The stt utility provides a longer example of a fully functional and useful program based on libdat.a.
You may be happy with your current test setup, but consider the following questions. Could you do more if your OS was more capable? What if you could write C programs and shell scripts, instead of DOS batch files? What if your test system was fully networked? Could you run the log files through a Perl filter to format them and display them on your internal web site? Could you benefit from the standard UNIX utilities, which you don't have to rewrite? Certainly you could benefit from attaching more than one controller to your system and running more than one type of test at the same time while your OS took care of the multitasking. What if there was a generic, easy-to-use SCSI interface and library that gave you full control of your SCSI devices as well as access to all source code? What if you could do your development on a platform with a rich set of development tools, including compilers, debuggers, version control systems, etc? Next time you are considering a platform for your SCSI testing, look at the answers to these questions and do yourself a favor. Consider how much more you could do, if that platform was running Linux.
Pete Popov is a firmware engineer at Sony's Advanced Storage Development Division in San Jose, CA, currently working on Sony's AIT-2 tape drive. The director of his division is still skeptical of Linux, but he just made the huge leap from a Macintosh to a PC, so he needs a little more time to come around. Pete can be contacted at firstname.lastname@example.org.
Practical Task Scheduling Deployment
July 20, 2016 12:00 pm CDT
One of the best things about the UNIX environment (aside from being stable and efficient) is the vast array of software tools available to help you do your job. Traditionally, a UNIX tool does only one thing, but does that one thing very well. For example, grep is very easy to use and can search vast amounts of data quickly. The find tool can find a particular file or files based on all kinds of criteria. It's pretty easy to string these tools together to build even more powerful tools, such as a tool that finds all of the .log files in the /home directory and searches each one for a particular entry. This erector-set mentality allows UNIX system administrators to seem to always have the right tool for the job.
Cron traditionally has been considered another such a tool for job scheduling, but is it enough? This webinar considers that very question. The first part builds on a previous Geek Guide, Beyond Cron, and briefly describes how to know when it might be time to consider upgrading your job scheduling infrastructure. The second part presents an actual planning and implementation framework.
Join Linux Journal's Mike Diehl and Pat Cameron of Help Systems.
Free to Linux Journal readers.Register Now!
- SUSE LLC's SUSE Manager
- My +1 Sword of Productivity
- Non-Linux FOSS: Caffeine!
- Managing Linux Using Puppet
- Control Your Linux Desktop with D-Bus
- Download "Linux Management with Red Hat Satellite: Measuring Business Impact and ROI"
- Doing for User Space What We Did for Kernel Space
- SuperTuxKart 0.9.2 Released
- Murat Yener and Onur Dundar's Expert Android Studio (Wrox)
- Google's SwiftShader Released
With all the industry talk about the benefits of Linux on Power and all the performance advantages offered by its open architecture, you may be considering a move in that direction. If you are thinking about analytics, big data and cloud computing, you would be right to evaluate Power. The idea of using commodity x86 hardware and replacing it every three years is an outdated cost model. It doesn’t consider the total cost of ownership, and it doesn’t consider the advantage of real processing power, high-availability and multithreading like a demon.
This ebook takes a look at some of the practical applications of the Linux on Power platform and ways you might bring all the performance power of this open architecture to bear for your organization. There are no smoke and mirrors here—just hard, cold, empirical evidence provided by independent sources. I also consider some innovative ways Linux on Power will be used in the future.Get the Guide