/ Documentation / Tests / USB flash drive
en | ru

USB flash drive (usb-flash-drive)

Test destroys contents of HDD

This test allows to check the working ability of USB ports and/or plugged USB storage devices. A user has to plug the USB storage devices (such as USB flash drives) in every USB port of system under test. A number of USB storage drives is passed then as a COUNT parameter to this test script. First of all, it checks if a required number of USB devices is plugged in: the test won’t start if it’s not so. This way, a non-working USB port would be diagnosed. The test itself does the following for every detected USB storage device: it writes a number of blocks wit random data (start position is choosen randomly to increase an USB drive’s lifetime) and remembers their checksum, then it clears the disk cache and reads these blocks back, calculating checksum. If checksums match, USB device and port work properly. This test also acts as a benchmark: it measures write and read speeds. This metric can be used to diagnose bad ports/USB devices (due to speed lower than required minimum).

  • Components tested: USB, USB Mass Storage
  • Variables:
    • BLOCKSIZE (int, default: 1024) — Blocksize used for reading and writing by dd, KiB
    • COUNT (int, default: 2) — There should be this many devices
    • SIZE (int, default: 20) — Size of test file to be written, Blocksizes