common.zsh: Pull out common test config into a shared file

Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
Anna Schumaker 2022-04-22 14:55:26 -04:00
parent 59d2891198
commit f757dec0ab
5 changed files with 54 additions and 28 deletions

30
common.zsh Normal file
View File

@ -0,0 +1,30 @@
#!/bin/zsh
##############################
# #
# NFS client configuration #
# #
##############################
CLIENT=(client)
MOUNTPOINT=(/mnt/test)
SCRATCHMNT=(/mnt/scratch)
##############################
# #
# NFS server configuration #
# #
##############################
SERVER=(server)
EXPORT=(/srv/xfs/test)
SCRATCH=(/srv/xfs/scratch)
###########################
# #
# General configuration #
# #
###########################
BIN=$HOME/bin
USER=$(whoami)
VERSION=(3 4.0 4.1 4.2)
PROTO=(tcp)

View File

@ -1,8 +1,5 @@
#!/bin/zsh -e #!/bin/zsh -e
CLIENT=(client) source common.zsh
SERVER=(server)
EXPORT=(/srv/test)
MOUNTPOINT=(/mnt/test)
zparseopts -F -K \ zparseopts -F -K \
c:=CLIENT -client:=CLIENT \ c:=CLIENT -client:=CLIENT \
@ -14,10 +11,8 @@ zparseopts -F -K \
s:=SERVER -server:=SERVER \ s:=SERVER -server:=SERVER \
x:=EXPORT -export:=EXPORT x:=EXPORT -export:=EXPORT
BIN=$HOME/bin
COLOR=$BIN/colors/cthon.py COLOR=$BIN/colors/cthon.py
RUN_CTHON="cd cthon04 && sudo ./runcthon" RUN_CTHON="cd cthon04 && sudo ./runcthon"
USER=$(whoami)
# #
# Prepare to test # Prepare to test

View File

@ -1,19 +1,22 @@
#!/bin/zsh -e #!/bin/zsh -e
CLIENT=(client) source common.zsh
SERVER=(server)
EXPORT=(/srv/test)
MOUNTPOINT=(/mnt/test/)
zparseopts -F -K \ zparseopts -F -K \
c:=CLIENT -client:=CLIENT \ c:=CLIENT -client:=CLIENT \
-dmesg=DMESG -srvdmesg=SRVDMESG \
p:=MOUNTPOINT -mountpoint:=MOUNTPOINT \ p:=MOUNTPOINT -mountpoint:=MOUNTPOINT \
s:=SERVER -server:=SERVER \ s:=SERVER -server:=SERVER \
x:=EXPORT -export:=EXPORT x:=EXPORT -export:=EXPORT
BIN=$HOME/bin
USER=$(whoami)
RUN_NFSTEST="run-nfstest-rplus.zsh" RUN_NFSTEST="run-nfstest-rplus.zsh"
if [ ${#DMESG} -gt 0 ]; then
ssh ${CLIENT[-1]} "sudo dmesg --clear"
fi
if [ ${#SRVDMESG} -gt 0 ]; then
ssh ${SERVER[-1]} "sudo dmesg --clear"
fi
# #
# Prepare to test # Prepare to test
# #
@ -26,8 +29,18 @@ echo
# #
# Run tests # Run tests
# #
# set +e
ssh -t ${CLIENT[-1]} "$RUN_NFSTEST --server ${SERVER[-1]} \ ssh -t ${CLIENT[-1]} "$RUN_NFSTEST --server ${SERVER[-1]} \
--export ${EXPORT[-1]} \ --export ${EXPORT[-1]} \
--mountpoint ${MOUNTPOINT[-1]} \ --mountpoint ${MOUNTPOINT[-1]} \
--user $USER" --user $USER"
ret=$?
if [ ${#DMESG} -gt 0 ]; then
ssh ${CLIENT[-1]} "sudo dmesg --color=always"
fi
if [ ${#SRVDMESG} -gt 0 ]; then
ssh ${SERVER[-1]} "sudo dmesg --color=always"
fi
exit $ret

View File

@ -1,8 +1,5 @@
#!/bin/zsh -e #!/bin/zsh -e
CLIENT=(client) source common.zsh
SERVER=(server)
EXPORT=(/srv/test)
MOUNTPOINT=(/mnt/test)
SIZE=(2048) SIZE=(2048)
ITERATIONS=(1) ITERATIONS=(1)
@ -16,11 +13,9 @@ zparseopts -F -K \
x:=EXPORT -export:=EXPORT \ x:=EXPORT -export:=EXPORT \
z:=SIZE -size:=SIZE z:=SIZE -size:=SIZE
BIN=$HOME/bin
COLOR="python -u $BIN/colors/read_plus.py ${SIZE[-1]} ${FILE[-1]}" COLOR="python -u $BIN/colors/read_plus.py ${SIZE[-1]} ${FILE[-1]}"
IFLAG= IFLAG=
RUN_READ_PLUS="sudo run-read_plus.zsh" RUN_READ_PLUS="sudo run-read_plus.zsh"
USER=$(whoami)
SRV_DIR=${EXPORT[-1]}/$USER/read_plus SRV_DIR=${EXPORT[-1]}/$USER/read_plus
TEST_DIR=${MOUNTPOINT[-1]}/read_plus TEST_DIR=${MOUNTPOINT[-1]}/read_plus
TEST_DEV=${SERVER[-1]}:$SRV_DIR TEST_DEV=${SERVER[-1]}:$SRV_DIR

View File

@ -1,10 +1,5 @@
#!/bin/zsh -e #!/bin/zsh -e
CLIENT=(client) source common.zsh
SERVER=(server)
EXPORT=(/srv/test)
SCRATCH=(/srv/scratch)
MOUNTPOINT=(/mnt/test)
SCRATCHMNT=(/mnt/scratch)
VERSION=(3 4.0 4.1 4.2) VERSION=(3 4.0 4.1 4.2)
PROTO=(tcp) PROTO=(tcp)
@ -19,11 +14,9 @@ zparseopts -D -K \
x:=EXPORT -export:=EXPORT \ x:=EXPORT -export:=EXPORT \
v+:=VERSION -version+:=VERSION v+:=VERSION -version+:=VERSION
BIN=$HOME/bin
COLOR=$BIN/colors/xfstests.py COLOR=$BIN/colors/xfstests.py
RUN_XFSTESTS="sudo run-xfstests.zsh" RUN_XFSTESTS="sudo run-xfstests.zsh"
OPTIONS="sec=sys" OPTIONS="sec=sys"
USER=$(whoami)
RESULT_BASE=$HOME/.local/share/xfstests/ RESULT_BASE=$HOME/.local/share/xfstests/
DATE=$(date +%Y-%m-%d-%H:%M:%S%z) DATE=$(date +%Y-%m-%d-%H:%M:%S%z)
TODAY=$(date +%Y/%m/%d) TODAY=$(date +%Y/%m/%d)
@ -93,4 +86,4 @@ if [ ! -z "$TAG" ]; then
mkdir -p $TAGRES mkdir -p $TAGRES
ln $RESULTS/$NOW.tar.xz $TAGRES/$DATE.tar.xz ln $RESULTS/$NOW.tar.xz $TAGRES/$DATE.tar.xz
fi fi
optirun report-xfstests.py $RESULTS/$NOW.tar.xz & disown report-xfstests.py $RESULTS/$NOW.tar.xz & disown