Add test script for nfstest read plus

Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
Anna Schumaker 2022-04-22 12:30:44 -04:00
parent dd97c7079b
commit 59d2891198
4 changed files with 61 additions and 1 deletions

View File

@ -0,0 +1,15 @@
#compdef nfstest_rplus.zsh
function _nfstest_rplus.zsh() {
_arguments \
{-c,--client}'[the client to test]: : _alternative
"hosts\:hosts\: _ssh_hosts"
"domains\:domains\:($(virsh list --all --name))"' \
--dmesg'[print client dmesg log after running tests]' \
--srvdmesg'[print server dmesg log after running tests]' \
{-p,--mountpoint}'[the directory to mount the server]: : _files -/' \
{-s,--server}'[the server to test against]: : _alternative
"hosts\:hosts\: _ssh_hosts"
"domains\:domains\:($(virsh list --all --name))"' \
{-x,--export}'[the exported directory on the server]: : _files -/'
}

View File

@ -3,7 +3,8 @@
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)
setup-read_plus.zsh setup-read_plus-files.py
run-nfstest-rplus.zsh)
function install_script() {
ssh $1 mkdir -p bin/

33
nfstest_rplus.zsh Executable file
View File

@ -0,0 +1,33 @@
#!/bin/zsh -e
CLIENT=(client)
SERVER=(server)
EXPORT=(/srv/test)
MOUNTPOINT=(/mnt/test/)
zparseopts -F -K \
c:=CLIENT -client:=CLIENT \
p:=MOUNTPOINT -mountpoint:=MOUNTPOINT \
s:=SERVER -server:=SERVER \
x:=EXPORT -export:=EXPORT
BIN=$HOME/bin
USER=$(whoami)
RUN_NFSTEST="run-nfstest-rplus.zsh"
#
# Prepare to test
#
$BIN/vm.zsh boot ${CLIENT[-1]} ${SERVER[-1]}
$BIN/install-scripts.zsh ${CLIENT[-1]}
ssh ${CLIENT[-1]} "sudo setup-testdirs.zsh ${SERVER[-1]} ${EXPORT[-1]} ${MOUNTPOINT[-1]} $USER"
echo
#
# Run tests
#
#
ssh -t ${CLIENT[-1]} "$RUN_NFSTEST --server ${SERVER[-1]} \
--export ${EXPORT[-1]} \
--mountpoint ${MOUNTPOINT[-1]} \
--user $USER"

11
run-nfstest-rplus.zsh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/zsh
zparseopts -D -K -server:=SERVER -export:=EXPORT \
-mountpoint:=MOUNTPOINT -user:=USER
NFSTEST_DIR=/home/anna/nfstest
export PYTHONPATH=$NFSTEST_DIR
$NFSTEST_DIR/test/nfstest_rplus --server ${SERVER[-1]} \
--export ${EXPORT[-1]}/${USER[-1]}/nfsv42tcp \
--mtpoint ${MOUNTPOINT[-1]}/test/nfsv42tcp