Whamcloud - gitweb
LU-1798 tests: add set_and_check to test-framework
[fs/lustre-release.git] / lustre / tests / test-framework.sh
index b8e0101..b85a480 100644 (file)
@@ -190,11 +190,11 @@ init_test_env() {
         fi
     fi
     export LL_DECODE_FILTER_FID=${LL_DECODE_FILTER_FID:-"$LUSTRE/utils/ll_decode_filter_fid"}
-    [ ! -f "$LL_DECODE_FILTER_FID" ] && export LL_DECODE_FILTER_FID=$(which ll_decode_filter_fid)
+    [ ! -f "$LL_DECODE_FILTER_FID" ] && export LL_DECODE_FILTER_FID="ll_decode_filter_fid"
     export MKFS=${MKFS:-"$LUSTRE/utils/mkfs.lustre"}
-    [ ! -f "$MKFS" ] && export MKFS=$(which mkfs.lustre)
+    [ ! -f "$MKFS" ] && export MKFS="mkfs.lustre"
     export TUNEFS=${TUNEFS:-"$LUSTRE/utils/tunefs.lustre"}
-    [ ! -f "$TUNEFS" ] && export TUNEFS=$(which tunefs.lustre)
+    [ ! -f "$TUNEFS" ] && export TUNEFS="tunefs.lustre"
     export CHECKSTAT="${CHECKSTAT:-"checkstat -v"} "
     export LUSTRE_RMMOD=${LUSTRE_RMMOD:-$LUSTRE/scripts/lustre_rmmod}
     [ ! -f "$LUSTRE_RMMOD" ] &&
@@ -375,6 +375,7 @@ llite_lloop_enabled() {
 }
 
 load_modules_local() {
+       [ $(facet_fstype ost1) == "zfs" ] && export USE_OFD=yes
        if [ "$USE_OFD" == yes ]; then
                if module_loaded obdfilter; then
                        if ! $LUSTRE_RMMOD ldiskfs; then
@@ -454,6 +455,7 @@ load_modules_local() {
         grep -q -w jbd2 $SYMLIST || { modprobe jbd2 2>/dev/null || true; }
                [ "$LQUOTA" != "no" ] && load_module quota/lquota $LQUOTAOPTS
                if [[ $(node_fstypes $HOSTNAME) == *zfs* ]]; then
+                       modprobe zfs
                        load_module osd-zfs/osd_zfs
                fi
                load_module mgs/mgs
@@ -479,6 +481,7 @@ load_modules_local() {
                else
                        load_module obdfilter/obdfilter
                fi
+               load_module osp/osp
     fi
 
 
@@ -3049,6 +3052,25 @@ osc_ensure_active () {
     [ $period -lt $timeout ] || log "$count OST are inactive after $timeout seconds, give up"
 }
 
+set_conf_param_and_check() {
+       local myfacet=$1
+       local TEST=$2
+       local PARAM=$3
+       local ORIG=$(do_facet $myfacet "$TEST")
+       if [ $# -gt 3 ]; then
+               local FINAL=$4
+       else
+               local -i FINAL
+               FINAL=$((ORIG + 5))
+       fi
+       echo "Setting $PARAM from $ORIG to $FINAL"
+       do_facet mgs "$LCTL conf_param $PARAM='$FINAL'" ||
+               error "conf_param $PARAM failed"
+
+       wait_update $(facet_host $myfacet) "$TEST" "$FINAL" ||
+               error "check $PARAM failed!"
+}
+
 init_param_vars () {
        remote_mds_nodsh ||
                TIMEOUT=$(do_facet $SINGLEMDS "lctl get_param -n timeout")