else
dirname="$(printf "${mdtbasedir}" $mdtidx)${basedir}${idx}"
fi
- remote_shell $host $lctl --device $devno test_mkdir /$dirname \
+ remote_shell $host $LCTL --device $devno test_mkdir /$dirname \
-c $dir_stripes --stripe_index $mdtidx > $rfile 2>&1
while read line; do
echo "$line" | grep -q 'error: test_mkdir'
else
dirname="$(printf "${mdtbasedir}" $mdtidx)${basedir}${idx}"
fi
- remote_shell $host $lctl --device $devno test_rmdir /$dirname > $rfile 2>&1
+ remote_shell $host $LCTL --device $devno test_rmdir /$dirname > $rfile 2>&1
done
}
unset lustre_root
fi
-if [ -z "$lustre_root" ]; then
- lctl=lctl
-else
- lctl=${lustre_root}/utils/lctl
+# find where 'lctl' binary is installed on this system
+if [[ -x "$LCTL" ]]; then # full pathname specified
+ : # echo "LCTL=$LCTL"
+elif [[ -n "$lustre_root" && -x "$lustre_root/utils/lctl" ]]; then
+ LCTL=${lustre_root}/utils/lctl
+elif [[ -n "$LUSTRE" && -x "$LUSTRE/utils/lctl" ]]; then
+ LCTL=$LUSTRE/utils/lctl
+else # hope that it is in the PATH
+ LCTL=${LCTL:-lctl}
fi
+[[ -n "$(which $LCTL)" ]] || { echo "error: lctl not found"; exit 99; }
declare -a client_names
declare -a host_names
declare -a client_indexes
if [ -z "$targets" ]; then
- targets=$($lctl device_list | awk "{if (\$2 == \"UP\" && \
+ targets=$($LCTL device_list | awk "{if (\$2 == \"UP\" && \
\$3 == \"mdt\") {print \$4} }")
if [ -z "$targets" ]; then
echo "Can't find any MDT to test. Please set targets=..."
if (( $stripe_count > 0 )); then
for ((i=0; i < $ndevs; i++)); do
host=${host_names[$i]}
- obd=$(remote_shell $host $lctl device_list |
+ obd=$(remote_shell $host $LCTL device_list |
awk "{ if (\$2 == \"UP\" &&
(\$3 == \"osc\" || \$3 == \"osp\"))
{ print \$4 } }")
tmpfi="${tmpf}_$idx"
[ "$test" = "create" ] && test="create -c $stripe_count"
echo >> ${cmdsf}_${host} \
- "$lctl > $tmpfi 2>&1 \
+ "$LCTL > $tmpfi 2>&1 \
--threads $thr -$snap $devno test_$test \
-d /$dirname -D $dir_count \
-b $start_number -n $file_count_per_thread"