common.zsh: Add automatic version verification

And expand "-v 4" to run all NFS v4 minorversions

Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
Anna Schumaker 2022-04-26 10:56:09 -04:00
parent 3428879918
commit 600fd846dc
3 changed files with 13 additions and 6 deletions

View File

@ -29,7 +29,7 @@ DMESG=()
PROTO=(tcp) PROTO=(tcp)
SRVDMESG=() SRVDMESG=()
USER=$(whoami) USER=$(whoami)
VERSION=(3 4.0 4.1 4.2) VERSION=(3 4)
###################### ######################
@ -70,9 +70,20 @@ function prepare_to_test()
$BIN/rping.zsh ${RDMA[-1]} ${CLIENT[-1]} ${SERVER[-1]} $BIN/rping.zsh ${RDMA[-1]} ${CLIENT[-1]} ${SERVER[-1]}
fi fi
setup_client_func setup_client_func
check_versions
echo echo
} }
function check_versions()
{
valid=(3 4.0 4.1 4.2)
if [[ ${VERSION[(ie)4]} -le ${#VERSION} ]]; then
VERSION+=(4.0 4.1 4.2)
fi
VERSION=(${(ou)VERSION})
VERSION=(${VERSION:*valid})
}
TRAPEXIT() TRAPEXIT()
{ {
if [ ${#DMESG} -gt 0 ]; then if [ ${#DMESG} -gt 0 ]; then

View File

@ -13,6 +13,6 @@ function _xfstests.zsh() {
{-s,--server}'[the server to test against]: : _alternative {-s,--server}'[the server to test against]: : _alternative
"hosts\:hosts\: _ssh_hosts" "hosts\:hosts\: _ssh_hosts"
"domains\:domains\:($(virsh list --all --name))"' \ "domains\:domains\:($(virsh list --all --name))"' \
\*{-v,--version}+'[the nfs version to test (default=all)]: :(3 4.0 4.1 4.2)' \ \*{-v,--version}+'[the nfs version to test (default=all)]: :(3 4 4.0 4.1 4.2)' \
{-x,--export}'[the exported directory on the server]: : _files -/' {-x,--export}'[the exported directory on the server]: : _files -/'
} }

View File

@ -66,10 +66,6 @@ run_xfs_tests() {
mkdir -p $TMP_RESULTS mkdir -p $TMP_RESULTS
for proto in $PROTO; do for proto in $PROTO; do
for vers in $VERSION; do for vers in $VERSION; do
case $vers in
"-v" | "--version") continue ;;
esac
run_xfs_tests $proto $vers & run_xfs_tests $proto $vers &
done done
done done