Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / lustre / tests / test-framework.sh
index dc71129..dd596d6 100644 (file)
@@ -219,9 +219,10 @@ load_modules() {
     load_module ../libcfs/libcfs/libcfs
     [ "$PTLDEBUG" ] && lctl set_param debug=$PTLDEBUG
     [ "$SUBSYSTEM" ] && lctl set_param subsystem_debug=${SUBSYSTEM# }
+    local MODPROBECONF=
     [ -f /etc/modprobe.conf ] && MODPROBECONF=/etc/modprobe.conf
-    [ -f /etc/modprobe.d/Lustre ] && MODPROBECONF=/etc/modprobe.d/Lustre
-    [ -z "$LNETOPTS" -a -n "$MODPROBECONF" ] && \
+    [ ! "$MODPROBECONF" -a -d /etc/modprobe.d ] && MODPROBECONF=/etc/modprobe.d/Lustre
+    [ -z "$LNETOPTS" -a "$MODPROBECONF" ] && \
         LNETOPTS=$(awk '/^options lnet/ { print $0}' $MODPROBECONF | sed 's/^options lnet //g')
     echo $LNETOPTS | grep -q "accept=all"  || LNETOPTS="$LNETOPTS accept=all";
     echo "lnet options: '$LNETOPTS'"
@@ -2134,3 +2135,20 @@ check_catastrophe () {
     fi 
 }
 
+# $1 node
+# $2 file
+get_stripe_info() {
+       local tmp_file
+
+       stripe_size=0
+       stripe_count=0
+       stripe_index=0
+       tmp_file=$(mktemp)
+
+       do_facet $1 lfs getstripe -v $2 > $tmp_file
+
+       stripe_size=`awk '$1 ~ /size/ {print $2}' $tmp_file`
+       stripe_count=`awk '$1 ~ /count/ {print $2}' $tmp_file`
+       stripe_index=`awk '/obdidx/ {start = 1; getline; print $1; exit}' $tmp_file`
+       rm -f $tmp_file
+}