Move setup-* and run-* scripts into subdirectories

The common prefixes in these scripts indicate that they should really be
in directories and not the toplevel. I also provide a helper script in
$BIN to assist in calling them on the target VMs

Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
Anna Schumaker 2022-04-25 14:43:34 -04:00
parent a2453af9cc
commit 3428879918
12 changed files with 48 additions and 35 deletions

View File

@ -37,12 +37,22 @@ VERSION=(3 4.0 4.1 4.2)
# Shared functions #
# #
######################
function client_run()
{
zparseopts -D -K t=TERMINAL
[[ ! -z $TERMINAL ]] && SSH_OPT="-t"
ssh $SSH_OPT ${CLIENT[-1]} sudo run.zsh $*
}
function client_setup()
{
ssh ${CLIENT[-1]} sudo setup.zsh $*
}
function setup_client_func()
{
ssh ${CLIENT[-1]} "sudo setup-testdirs.zsh ${SERVER[-1]} \
${EXPORT[-1]} \
${MOUNTPOINT[-1]} \
$USER"
client_setup testdirs.zsh ${SERVER[-1]} ${EXPORT[-1]} \
${MOUNTPOINT[-1]} $USER
}
function prepare_to_test()

View File

@ -1,17 +1,15 @@
#!/bin/zsh
BIN=$HOME/bin
SCRIPTS=(grub-list.zsh setup-testdirs.zsh \
setup-xfstests.zsh run-xfstests.zsh \
setup-read_plus.zsh setup-read_plus-files.py
run-nfstest-rplus.zsh)
SCRIPTS=(grub-list.zsh setup.zsh setup/ run/)
function install_script() {
ssh $1 mkdir -p bin/
ssh $1 mkdir -p bin/{setup,run}
echo -n "$2 Copying files ..."
for script in $SCRIPTS; do
scp -q $BIN/$script $1:bin/
scp -qr $BIN/$script $1:bin/
done
ssh $1 cp bin/setup.zsh bin/run.zsh
echo " done"
}

View File

@ -8,10 +8,8 @@ zparseopts -F -K \
s:=SERVER -server:=SERVER \
x:=EXPORT -export:=EXPORT
RUN_NFSTEST="run-nfstest-rplus.zsh"
prepare_to_test
ssh -t ${CLIENT[-1]} "$RUN_NFSTEST --server ${SERVER[-1]} \
--export ${EXPORT[-1]} \
--mountpoint ${MOUNTPOINT[-1]} \
--user $USER"
client_run -t nfstest-rplus.zsh --server ${SERVER[-1]} \
--export ${EXPORT[-1]} \
--mountpoint ${MOUNTPOINT[-1]} \
--user $USER

View File

@ -15,7 +15,6 @@ zparseopts -F -K \
COLOR="python -u $BIN/colors/read_plus.py ${SIZE[-1]} ${FILE[-1]}"
IFLAG=
RUN_READ_PLUS="sudo run-read_plus.zsh"
SRV_DIR=${EXPORT[-1]}/$USER/read_plus
TEST_DIR=${MOUNTPOINT[-1]}/read_plus
TEST_DEV=${SERVER[-1]}:$SRV_DIR
@ -27,8 +26,9 @@ TIME_CMD="sudo /usr/bin/time -f \"%Ss kern, %P cpu\""
#
function setup_client_func()
{
ssh ${CLIENT[-1]} "sudo setup-read_plus.zsh ${SERVER[-1]} ${EXPORT[-1]} \
${MOUNTPOINT[-1]} $USER ${SIZE[-1]} 1,2,4,8,16" | eval ${COLOR}
client_setup read_plus.zsh ${SERVER[-1]} ${EXPORT[-1]} \
${MOUNTPOINT[-1]} $USER ${SIZE[-1]} \
1,2,4,8,16 | eval ${COLOR}
}
prepare_to_test

8
setup.zsh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/zsh
[[ "$(basename $0)" == "run.zsh" ]] && TARGET=bin/run || TARGET=bin/setup
TARGET=$TARGET/$1
shift
[[ -x $TARGET ]] && $TARGET $*

View File

@ -18,5 +18,5 @@ TRAPEXIT() {
}
mkdir -p -m 777 $MOUNTPOINT/$USER/read_plus
setup-read_plus-files.py $MOUNTPOINT/$USER/read_plus $SIZE $CHUNKS
bin/setup/read_plus-files.py $MOUNTPOINT/$USER/read_plus $SIZE $CHUNKS
sync

View File

@ -16,5 +16,5 @@ groupadd fsgqa 2>/dev/null
useradd --badnames 123456-fsgqa 2>/dev/null
useradd fsgqa2 2>/dev/null
setup-testdirs.zsh $SERVER $EXPORT $MOUNTPOINT $USER
setup-testdirs.zsh $SERVER $SCRATCH $SCRATCHMNT $USER
setup.zsh testdirs.zsh $SERVER $EXPORT $MOUNTPOINT $USER
setup.zsh testdirs.zsh $SERVER $SCRATCH $SCRATCHMNT $USER

View File

@ -15,7 +15,6 @@ zparseopts -D -K \
v+:=VERSION -version+:=VERSION
COLOR=$BIN/colors/xfstests.py
RUN_XFSTESTS="sudo run-xfstests.zsh"
OPTIONS="sec=sys"
RESULT_BASE=$HOME/.local/share/xfstests/
DATE=$(date +%Y-%m-%d-%H:%M:%S%z)
@ -34,9 +33,9 @@ fi
#
function setup_client_func()
{
ssh ${CLIENT[-1]} "sudo setup-xfstests.zsh ${SERVER[-1]} \
${EXPORT[-1]} ${MOUNTPOINT[-1]} \
${SCRATCH[-1]} ${SCRATCHMNT[-1]} $USER"
client_setup xfstests.zsh ${SERVER[-1]} ${EXPORT[-1]} \
${MOUNTPOINT[-1]} ${SCRATCH[-1]} \
${SCRATCHMNT[-1]} $USER
}
prepare_to_test
if [ ${#NCONNECT} -gt 0 ]; then
@ -49,15 +48,15 @@ for arg in $*; do
done
run_xfs_tests() {
ssh ${CLIENT[-1]} "$RUN_XFSTESTS --server ${SERVER[-1]} \
--export ${EXPORT[-1]} \
--mountpoint ${MOUNTPOINT[-1]} \
--scratch ${SCRATCH[-1]} \
--scratchmnt ${SCRATCHMNT[-1]} \
--proto $1 \
--version $2 \
--opts $OPTIONS \
--user $USER $testargs" | python $COLOR $1 $2
client_run xfstests.zsh --server ${SERVER[-1]} \
--export ${EXPORT[-1]} \
--mountpoint ${MOUNTPOINT[-1]} \
--scratch ${SCRATCH[-1]} \
--scratchmnt ${SCRATCHMNT[-1]} \
--proto $1 \
--version $2 \
--opts $OPTIONS \
--user $USER $testargs | python $COLOR $1 $2
scp -q ${CLIENT[-1]}:$REMOTE_RESULTS/$1/$2/result.xml $TMP_RESULTS/$1-$2.xml
}