X-Git-Url: https://git.whamcloud.com/gitweb?a=blobdiff_plain;f=lustre%2Ftests%2Ffunctions.sh;h=1dd9ac54800cbff745b0ebc51fd06080fb0a6c7b;hb=874211b2e56953a973d30d7aa723de50bed2fee0;hp=83f109db1c2ef127e653daef66877efbf94d7068;hpb=05da6e66437d32eb686cb787c1628b7faf68523c;p=fs%2Flustre-release.git diff --git a/lustre/tests/functions.sh b/lustre/tests/functions.sh index 83f109d..1dd9ac5 100644 --- a/lustre/tests/functions.sh +++ b/lustre/tests/functions.sh @@ -48,3 +48,53 @@ mpi_run () { return $rc } +nids_list () { + local list + for i in ${1//,/ }; do + list="$list $i@$NETTYPE" + done + echo $list +} + +# FIXME: all setup/cleanup can be done without rpc.sh +lst_end_session () { + local verbose=false + [ x$1 = x--verbose ] && verbose=true + + export LST_SESSION=`$LST show_session 2>/dev/null | awk -F " " '{print $5}'` + [ "$LST_SESSION" == "" ] && return + + if $verbose; then + $LST show_error c s + fi + $LST stop b + $LST end_session +} + +lst_session_cleanup_all () { + local list=$(comma_list $(nodes_list)) + do_rpc_nodes $list lst_end_session +} + +lst_cleanup () { + lsmod | grep -q lnet_selftest && rmmod lnet_selftest > /dev/null 2>&1 || true +} + +lst_cleanup_all () { + local list=$(comma_list $(nodes_list)) + + # lst end_session needs to be executed only locally + # i.e. on node where lst new_session was called + lst_end_session --verbose + do_rpc_nodes $list lst_cleanup +} + +lst_setup () { + load_module lnet_selftest +} + +lst_setup_all () { + local list=$(comma_list $(nodes_list)) + do_rpc_nodes $list lst_setup +} +