#! /bin/csh -f
#
#  Run iorate tests for automated tiering
#

# List of device files to test against
set devs = devices 

# List the automated tiering test plan to use - should be ONE test
set tests = tests-ast

# Note the level of shift to use on the skew
set shift = 0

# Archive directory to place the results in
set archive = data

# Set silent mode - only warnings and errors are visible
set silent = -s


# Note which run we are doing
@ count = `cat run_ast.count` + 1
echo $count > run_ast.count

# Make the archive space if needed
if ( ! -d $archive ) then
    mkdir $archive
endif

# Log the start
date +"Starting io test pass "$count" at %T on %A, %B %e, %Y" | tee -a run_ast.log

# In case silent is not set, make sure it is defined
if ( ! $?silent ) set silent = ""

# Run each device file
foreach dev ( $devs )

# Run each test file
    foreach test ( $tests )

	set target = ( $silent -f $dev".ior" -t $test".ior" )

	./iorate $target -c$shift -o $archive"/run_ast."$count

# this is VMAX FAST VP specific, to gather tiering statistics after each run
	symfast list -tech ALL -demand -v -vp >& $archive"/run_ast.fastvp."$count".log"

    end

end

# Note we are done
date +"Finished pass "$count" at %T on %A, %B %e, %Y" | tee -a run_ast.log

