#
# Copyright (c) 2000-2001 Silicon Graphics, Inc.  All Rights Reserved.
#
#---------------------------------------------------------------------------
# CONFIGURATION SECTION:  
#    Configure this script by changing the variables in this section.
#    Please change ONLY this section!
#---------------------------------------------------------------------------

# Base directory:
base_dir="~jayw/test"

# Primary username:
p_user="jayw"

# Path to the mountpoint of the test filesystem:
m_main="/dmitest"

# m_main concatenated with d_name == the full test directory path
#
# EXAMPLE:  If m_main is "/dmitest", and the test directory
# is "/dmitest/test", set this to "/test"
#
d_name="/test"

# Path to the mountpoint of the nfs2 test filesystem:
m_nfs2="/dmiv2"

# Path to the mountpoint of the nfs3 test filesystem:
m_nfs3="/dmiv3"

# Path to the mountpoint of the realtime test filesystem:
m_rt="/dmf"
# Path to the realtime test directory:
d_rt="$m_rt/kcm"

#--------------------------------------------------------------------
# END OF CONFIGURATION SECTION:
#    No changes should be made past this point!  Please change only   
#    the above shell variables to configure this script.
#--------------------------------------------------------------------

# Path to the "bindir" directory:
bin="$base_dir/bindir"

# Path to the "generic file" (a copy of ls): 
ls_path="$bin/ls_to_copy"

# Path to the main test directory:
d_main="$m_main$d_name"

# Path to the nfs2 test directory:
d_nfs2="$m_nfs2$d_name"

# Path to the nfs3 test directory:
d_nfs3="$m_nfs2$d_name"

#---------------------------------------------------------------------------
# Tests that run without a daemon
#---------------------------------------------------------------------------

# Automated C programs to test DMAPI functions 
alias do_dmattr="$bin/test_dmattr $ls_path $tdir"
alias do_eventlist="$bin/test_eventlist $ls_path $tdir"
alias do_fileattr="$bin/test_fileattr $ls_path $tdir"
alias do_hole="$bin/test_hole $ls_path $tdir"
alias do_invis="$bin/test_invis $ls_path $tdir"
alias do_region="$bin/test_region  $ls_path $tdir"
alias do_efault="$bin/test_efault $ls_path $tdir"
alias do_rights="$bin/test_rights $ls_path $tdir"

# Verbose versions of the above
alias dov_dmattr="$bin/test_dmattr -v $ls_path $tdir"
alias dov_eventlist="$bin/test_eventlist -v $ls_path $tdir"
alias dov_fileattr="$bin/test_fileattr -v $ls_path $tdir"
alias dov_hole="$bin/test_hole -v $ls_path $tdir"
alias dov_invis="$bin/test_invis -v $ls_path $tdir"
alias dov_region="$bin/test_region -v $ls_path $tdir"
alias dov_efault="$bin/efault -v $ls_path $tdir"
alias dov_rights="$bin/test_rights -v $ls_path $tdir"

# Scripts to test dm_get_allocinfo
alias do_allocinfo_1="$bin/test_allocinfo_1 $bin $tdir"
alias do_allocinfo_2="$bin/test_allocinfo_2  $bin $tdir"

#-------------------------------------------------------------------------------------------------
# Tests that load a DMAPI daemon and examine the generated events
#-------------------------------------------------------------------------------------------------

# Standard battery of tests:
alias do_standard="$bin/run_test -u $p_user -f standard.dat $bin $tdir $mdir"
alias do_standard_nfs2="$bin/run_test -u $p_user -F nfs2 -M $m_nfs2 -R $tdir -f standard_nfs.dat $bin $d_nfs2 $mdir"
alias do_standard_nfs3="$bin/run_test -u $p_user -F nfs3 -M $m_nfs3 -R $tdir -f standard_nfs.dat $bin $d_nfs3 $mdir"

# Some other, more specific tests:
alias do_main="$bin/run_test -u $p_user $bin $tdir $mdir"
alias do_nfs2="$bin/run_test -u $p_user -F nfs2 -M $m_nfs2 -R $tdir -f nfs.dat $bin $d_nfs2 $mdir"
alias do_nfs3="$bin/run_test -u $p_user -F nfs3 -M $m_nfs3 -R $tdir -f nfs.dat $bin $d_nfs3 $mdir"

alias do_pending="$bin/run_test -u $p_user -f pending.dat $bin $tdir $mdir"
alias do_pending_nfs2="$bin/run_test -u $p_user -F nfs2 -M $m_nfs2 -R $tdir -f pending_nfs.dat $bin $d_nfs2 $mdir"
alias do_pending_nfs3="$bin/run_test -u $p_user -F nfs3 -M $m_nfs3 -R $tdir -f pending_nfs.dat $bin $d_nfs3 $mdir"

alias do_failure="$bin/run_test -u $p_user -f fail.dat $bin $tdir $mdir"
alias do_failure_nfs2="$bin/run_test -u $p_user -F nfs2 -M $m_nfs2 -R $tdir -f fail.dat $bin $d_nfs2 $mdir"
alias do_failure_nfs3="$bin/run_test -u $p_user -F nfs3 -M $m_nfs3 -R $tdir -f fail.dat $bin $d_nfs3 $mdir"

# Realtime test:
alias do_realtime="$bin/run_test -u $p_user -f realtime.dat $bin $m_rt $d_rt"

# Small event queue test:  Set dm_max_queued to about 5 or so before running!
alias do_smallq="$bin/run_test -u $p_user -s 2 -f smallq.dat $bin $tdir $mdir"

#-------------------------------------------------------------------------------------------------
# Additional tools (these are NOT tests):
#-------------------------------------------------------------------------------------------------

alias check_for_daemon="ps -el | grep daemon"
alias do_daemon="$bin/dm_test_daemon $mdir"
