Original wbtest is
 * Copyright (C) 2003-2004 EMC Corporation
 *
 * wbtest.c - a testing utility for the write barrier file system 
 *            functionality.
 *
 * Written by Brett Russ <russb@emc.com>

rewritten to match my needs
 Copyright 2004 Lars Ellenberg <l.g.e@web.de>

----

wbtest.c README

Intentional Usage:

You should setup a pair of DRBD, mount it on one node, and run wbtest
on some path on that device. Then you can trigger more or less gracefull
failovers, and run wbtest on the other node.

Compile:

Easy!:  gcc -o wbtest wbtest.c

Summary:

The program starts and first scans the data dir for files matching the
expected naming convention. All unfinished files (ending in '+') will
then just be unlinked, all other files will be verified to match their
expected size and content.

This data dir should be empty on first run.  Finding none, wbtest will
begin to create processes whose job is to create new data files.  Each
process writes a number of files of size in range <min> to <max>
(default 4B -- 100KB) and then exits.  A max of <concurrent> procs are
launched at once.  A pass is defined as the cycle a process makes from
<min> to <max> or <max> to <min>; odd PIDs ascend, even PIDs descend.
A <passes> value of 0 runs to infinity.  After <recycle> passes, wbtest
starts to verify and remove single passes again, to avoid to fill up the
file system completely.

The point is to cut off power to the running machine at a random point
during the testing.  To do this, either set <passes> to 0 or ensure
that you set it high enough such that I/O is running when the power is
shut off.

On failover or reboot, the test data files are verified.
The file naming convention controlls the verification of the test data.
These files are named <pid>-<size>-<hexdigits>, and are expected to be
of size <size>, and to be filled with the four byte pattern <hexdigits>.
A file ending in an additional '+' was not yet completely written, so it
is not expected to verify correctly. It will just be removed in the
verification step.

If errors are found, testing stops and if a log file was provided the
file in error is logged.  All test data files that verify successfully
are removed.  Any test data files with errors are preserved for
inspection.

I think that's about it...here's the usage text:

Usage: ./wbtest [-hvV] [-m <min>] [-M <max>] [-p <passes>]
		[-r <recycle>] [-c <concurrent>] [-l <vLog>] -d <datadir>

./wbtest - Version 1.1-lge Options:
  -h prints this usage text
  -v SKIP verification step of existing files (if any)
  -V forces exit after verification step of existing files
  min         minimum IO size to use (bytes)
  max         maximum IO size to use (bytes)
  passes      # of passes to run (0 for INF)
  recycle     # of passes after which recycling of disk space starts
  concurrent  # of processes to run at once
  vLog        log (append) all file verify failures here.
              otherwise /tmp/wbtest-vLog-<timestamp>-<pid> will be used
  datadir     required; writable directory on DRBD to store 'test data' files
