scripts/setup/testdirs.zsh
Anna Schumaker 3428879918 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>
2022-04-26 10:33:01 -04:00

27 lines
452 B
Bash
Executable File

#!/bin/zsh
SERVER=$1
EXPORT=$2
MOUNTPOINT=$3
USER=$4
if [ "$#" -lt 4 ]; then
echo "Usage: $0 {server} {export} {mountpoint} {user}"
exit 1
fi
mkdir -p $MOUNTPOINT
mount -o sec=sys $SERVER:$EXPORT $MOUNTPOINT
for proto in tcp rdma; do
for vers in 3 4 41 42; do
dir=$MOUNTPOINT/$USER/nfsv$vers$proto
if [ ! -d $dir ]; then
mkdir -p -m 777 $dir
elif [ "$(ls -A $dir)" ]; then
rm -rf $dir/* || true
fi
done
done
umount -f $MOUNTPOINT