#!/bin/csh -f
#
# verify-run: run the verification tests
#
# This runs a series of tests to make sure things are working
# correctly.  It is intended to be used with REAL_DATA, but is not
# necessary.  Make sure to run make on 'verify2' so that it is
# also up to date.  Also note that some of these patterns are not
# appropriate for some of the cpfs (-single, -block, and -thread), or
# iopfs-block, because they have interprocess locality and those
# schemes don't support the necessary consistency.  If that is the
# case, supply the optional argument.
#
# usage: verify-run [inconsistent]
#
# Part of
#              The STARFISH Parallel file-system simulator
#        (Simulation Tool for Advanced Research in File Systems)
# 
#                               David Kotz
#                           Dartmouth College
#                              Version 3.0
#                              October 1996
#                          dfk@cs.dartmouth.edu

if ($1 != inconsistent) then
    set consistent=1
else
    set consistent=0
endif

alias dmcache proteus -t dmcache -abort -v

/bin/rm -f DISK??
echo > out

if ($consistent) then
    set pats = (wwn wwb wwc)
else
    set pats = (wwn wwb)
endif

foreach i ($pats)
    echo ---------------------------------------------- >> out
    echo $i >> out
    dmcache $i 16 16 >>& out
    verify2 1 >>& out
end

foreach i (wrn wrb wrc)
    echo ---------------------------------------------- >> out
    echo $i >> out
    dmcache $i 16 16 >>& out
end

if ($consistent) then
    set pats = (wwnn wwnb wwnc wwbn wwbb wwbc wwcn wwcb wwcc)
else
    set pats = (wwnn wwbn wwcn)		# ok for most record sizes
endif

foreach i ($pats)
    echo ---------------------------------------------- >> out
    echo $i >> out
    dmcache $i 16 16 >>& out
    verify2 2 >>& out
end

foreach i (wrnn wrnb wrnc wrbn wrbb wrbc wrcn wrcb wrcc)
    echo ---------------------------------------------- >> out
    echo $i >> out
    dmcache $i 16 16 >>& out
end

/bin/rm -f DISK??
