-#!/bin/sh
+#!/bin/bash
#
# CDDL HEADER START
#
-#!/bin/sh
+#!/bin/bash
# System Profiling Script
proc_dump_start() {
echo "$(date +%T): proc dump started...." >> $OUTPUTDIR/$HOSTNAME/summary
- sh -c '
+ bash -c '
CTRFILE=/$OUTPUTDIR/$HOSTNAME/tmp/running.$$.pid;
echo $$ > ${CTRFILE};
while [ -f $CTRFILE ]; do
-#!/bin/sh
+#!/bin/bash
set -evx
MOUNT=${MOUNT:-/mnt/lustre}
for index in $(seq $PARALLEL_RUNS); do
DIR=$ORIGIN_DIR/dir${index} PARALLEL=yes \
EXT2_DEV="$TMP/SANITY.LOOP_${index}" \
- LOGDIR="${LOGDIR}_${index}" YAML_LOG="" sh sanity.sh &
+ LOGDIR="${LOGDIR}_${index}" YAML_LOG="" bash sanity.sh &
pid=$!
echo start sanity: $pid
rpids="$rpids $pid"
}
mpi_run () {
- local mpirun="$MPIRUN $MPIRUN_OPTIONS"
- local command="$mpirun $@"
- local mpilog=$TMP/mpi.log
- local rc
-
- if [ -n "$MPI_USER" -a "$MPI_USER" != root -a -n "$mpirun" ]; then
- echo "+ chmod 0777 $MOUNT"
- chmod 0777 $MOUNT
- command="su $MPI_USER sh -c \"$command \""
- fi
+ local mpirun="$MPIRUN $MPIRUN_OPTIONS"
+ local command="$mpirun $@"
+ local mpilog=$TMP/mpi.log
+ local rc
+
+ if [ -n "$MPI_USER" -a "$MPI_USER" != root -a -n "$mpirun" ]; then
+ echo "+ chmod 0777 $MOUNT"
+ chmod 0777 $MOUNT
+ command="su $MPI_USER bash -c \"$command \""
+ fi
- ls -ald $MOUNT
- echo "+ $command"
- eval $command 2>&1 | tee $mpilog || true
+ ls -ald $MOUNT
+ echo "+ $command"
+ eval $command 2>&1 | tee $mpilog || true
- rc=${PIPESTATUS[0]}
- if [ $rc -eq 0 ] && grep -q "p4_error:" $mpilog ; then
- rc=1
- fi
- return $rc
+ rc=${PIPESTATUS[0]}
+ if [ $rc -eq 0 ] && grep -q "p4_error:" $mpilog ; then
+ rc=1
+ fi
+ return $rc
}
nids_list () {
ha_on $client $LFS setstripe $stripeparams $dir &&
ha_on $client $LFS getstripe $dir &&
ha_on $client chmod a+xwr $dir &&
- ha_on $client "su $mpiuser sh -c \" $mpirun $mpirunoptions \
+ ha_on $client "su $mpiuser bash -c \" $mpirun $mpirunoptions \
-np $((${#ha_clients[@]} * mpi_threads_per_client / ha_nclientsset)) \
$machines $cmd \" " || rc=$?
ha_on ${ha_clients[0]} "$check_attrs && \
# make batch
test_smoke_sub () {
- local servers=$1
- local clients=$2
+ local servers=$1
+ local clients=$2
- local nc=$(echo ${clients//,/ } | wc -w)
- local ns=$(echo ${servers//,/ } | wc -w)
- echo '#!/bin/bash'
- echo 'set -e'
+ local nc=$(echo ${clients//,/ } | wc -w)
+ local ns=$(echo ${servers//,/ } | wc -w)
+ echo '#!/bin/bash'
+ echo 'set -e'
- echo 'cleanup () { trap 0; echo killing $1 ... ; kill -9 $1 || true; }'
+ echo 'cleanup () { trap 0; echo killing $1 ... ; kill -9 $1 || true; }'
- echo "$LST new_session --timeo 100000 hh"
- echo "$LST add_group c $(nids_list $clients)"
- echo "$LST add_group s $(nids_list $servers)"
- echo "$LST add_batch b"
+ echo "$LST new_session --timeo 100000 hh"
+ echo "$LST add_group c $(nids_list $clients)"
+ echo "$LST add_group s $(nids_list $servers)"
+ echo "$LST add_batch b"
declare -a tests
done
done
- echo $LST run b
- echo sleep 1
- echo "$LST stat --delay 10 --timeout 10 c s &"
- echo 'pid=$!'
- echo 'trap "cleanup $pid" INT TERM'
- echo sleep $smoke_DURATION
- echo 'cleanup $pid'
-
+ echo $LST run b
+ echo sleep 1
+ echo "$LST stat --delay 10 --timeout 10 c s &"
+ echo 'pid=$!'
+ echo 'trap "cleanup $pid" INT TERM'
+ echo sleep $smoke_DURATION
+ echo 'cleanup $pid'
}
run_lst () {
- local file=$1
+ local file=$1
- export LST_SESSION=$$
+ export LST_SESSION=$$
- # start lst
- sh $file
+ # start lst
+ bash $file
}
check_lst_err () {
-#!/bin/sh
+#!/bin/bash
set -e
export PATH=`dirname $0`:`dirname $0`/../utils:$PATH
init_changelog
# Run dbench
- sh rundbench -C -D $DIR/$tdir 2 -t $DBENCH_TIME || error "dbench failed"
+ bash rundbench -C -D $DIR/$tdir 2 -t $DBENCH_TIME ||
+ error "dbench failed"
local LRSYNC_LOG=$(generate_logname "lrsync_log")
# Replicate the changes to $TGT
init_changelog
# Run dbench
- sh rundbench -C -D $DIR/$tdir 2 -t $DBENCH_TIME &
+ bash rundbench -C -D $DIR/$tdir 2 -t $DBENCH_TIME &
# wait for dbench to start
wait_for_function 'child_pid=$(pgrep dbench)' 360
# let dbench run for a bit
init_changelog
# Run dbench
- sh rundbench -C -D $DIR/$tdir 2 -t $DBENCH_TIME &
+ bash rundbench -C -D $DIR/$tdir 2 -t $DBENCH_TIME &
local LRSYNC_LOG=$(generate_logname "lrsync_log")
# Replicate the changes to $TGT
-#!/bin/sh
+#!/bin/bash
set -e
- #!/bin/bash
+#!/bin/bash
#
# This test was used in a set of CMD3 tests (cmd3-3 test).
# case 1 (local disk):
# $ nobjhi=2 thrhi=2 size=1024
# targets="$nid:$FSNAME-OST0000 $nid:$FSNAME-OST0001 ..."
- # sh obdfilter-survey
+ # ./obdfilter-survey
local_node && [ "$1" == "disk" ] || target=$nid:$target
targets="$targets $target"
done
start_dbench()
{
- NPROC=`cat /proc/cpuinfo 2>/dev/null | grep ^processor | wc -l`
- [ $NPROC -gt 2 ] && NPROC=2
- sh rundbench $NPROC 1>/dev/null &
- DBENCH_PID=$!
- sleep 2
-
- num=`ps --no-headers -p $DBENCH_PID 2>/dev/null | wc -l`
- if [ $num -ne 1 ]; then
- error "failed to start dbench $NPROC"
- else
- echo "started dbench with $NPROC processes at background"
- fi
-
- return 0
+ NPROC=`cat /proc/cpuinfo 2>/dev/null | grep ^processor | wc -l`
+ [ $NPROC -gt 2 ] && NPROC=2
+ bash rundbench $NPROC 1>/dev/null &
+ DBENCH_PID=$!
+ sleep 2
+
+ num=`ps --no-headers -p $DBENCH_PID 2>/dev/null | wc -l`
+ if [ $num -ne 1 ]; then
+ error "failed to start dbench $NPROC"
+ else
+ echo "started dbench with $NPROC processes at background"
+ fi
+
+ return 0
}
check_dbench()
{
local NPROC=$(grep -c ^processor /proc/cpuinfo)
[ $NPROC -gt 2 ] && NPROC=2
- sh rundbench $NPROC 1>/dev/null &
+ bash rundbench $NPROC 1>/dev/null &
DBENCH_PID=$!
sleep 2
-E -1 -c 4 -S 4M $parent ||
error "Set default layout to $parent failed"
- sh rundbench -C -D $parent 2 || error "dbench failed"
+ bash rundbench -C -D $parent 2 || error "dbench failed"
rm -fr $parent || error "Delete dir $parent failed"
}
test_64b () {
[ $PARALLEL == "yes" ] && skip "skip parallel run"
- sh oos.sh $MOUNT || error "oos.sh failed: $?"
+ bash oos.sh $MOUNT || error "oos.sh failed: $?"
}
run_test 64b "check out-of-space detection on client"
test_71() {
test_mkdir $DIR/$tdir
$LFS setdirstripe -D -c$MDSCOUNT $DIR/$tdir
- sh rundbench -C -D $DIR/$tdir 2 || error "dbench failed!"
+ bash rundbench -C -D $DIR/$tdir 2 || error "dbench failed!"
}
run_test 71 "Running dbench on lustre (don't segment fault) ===="
# Should not LBUG, just be killed by oom-killer
# dd will return 0 even allocation failure in some environment.
# So don't check return value
- sh -c "echo \$$ > $cgdir/tasks && dd if=$DIR/$tfile of=/dev/null"
+ bash -c "echo \$$ > $cgdir/tasks && dd if=$DIR/$tfile of=/dev/null"
cleanup_test411_cgroup $cgdir
return 0
run_test 11 "execution of file opened for write should return error ===="
test_12() {
- DIR=$DIR DIR2=$DIR2 sh lockorder.sh
+ DIR=$DIR DIR2=$DIR2 bash lockorder.sh
}
run_test 12 "test lock ordering (link, stat, unlink)"
test_15() { # bug 974 - ENOSPC
echo "PATH=$PATH"
- sh oos2.sh $MOUNT1 $MOUNT2
+ bash oos2.sh $MOUNT1 $MOUNT2
wait_delete_completed
grant_error=$(dmesg | grep "< tot_grant")
[ -z "$grant_error" ] || error "$grant_error"
test_30() { #b=11110, LU-2523
test_mkdir $DIR1/$tdir
cp -f /bin/bash $DIR1/$tdir/bash
- /bin/sh -c 'sleep 1; rm -f $DIR2/$tdir/bash; cp /bin/bash $DIR2/$tdir' &
+ bash -c 'sleep 1; rm -f $DIR2/$tdir/bash; cp /bin/bash $DIR2/$tdir' &
$DIR1/$tdir/bash -c 'sleep 2;
openfile -f O_RDONLY /proc/$$/exe >& /dev/null; echo $?'
wait
# trigger CoS twice in case transaction commit before unlock
for i in 1 2; do
- sh -c "$1"
+ bash -c "$1"
do_nodes $nodes "lctl set_param -n mdt.*.async_commit_count=0"
- sh -c "$2"
+ bash -c "$2"
commit_nr=$(do_nodes $nodes \
"lctl get_param -n mdt.*.async_commit_count" | calc_sum)
total=$((total + commit_nr));
eval $myPDSH $HOST "(PATH=\$PATH:$RLUSTRE/utils:$RLUSTRE/tests;
PATH=\$PATH:/sbin:/usr/sbin;
cd $RPWD;
- LUSTRE=\"$RLUSTRE\" sh -c \"$@\") ||
+ LUSTRE=\"$RLUSTRE\" bash -c \"$@\") ||
echo command failed >$command_status"
[[ -n "$($myPDSH $HOST cat $command_status)" ]] && return 1 ||
return 0
fi
- if [[ -n "$verbose" ]]; then
- # print HOSTNAME for myPDSH="no_dsh"
- if [[ $myPDSH = no_dsh ]]; then
- $myPDSH $HOST "(PATH=\$PATH:$RLUSTRE/utils:$RLUSTRE/tests:/sbin:/usr/sbin; cd $RPWD; LUSTRE=\"$RLUSTRE\" sh -c \"$@\")" | sed -e "s/^/${HOSTNAME}: /"
- else
- $myPDSH $HOST "(PATH=\$PATH:$RLUSTRE/utils:$RLUSTRE/tests:/sbin:/usr/sbin; cd $RPWD; LUSTRE=\"$RLUSTRE\" sh -c \"$@\")"
- fi
- else
- $myPDSH $HOST "(PATH=\$PATH:$RLUSTRE/utils:$RLUSTRE/tests:/sbin:/usr/sbin; cd $RPWD; LUSTRE=\"$RLUSTRE\" sh -c \"$@\")" | sed "s/^${HOST}: //"
- fi
- return ${PIPESTATUS[0]}
+ if [[ -n "$verbose" ]]; then
+ # print HOSTNAME for myPDSH="no_dsh"
+ if [[ $myPDSH = no_dsh ]]; then
+ $myPDSH $HOST \
+ "(PATH=\$PATH:$RLUSTRE/utils:$RLUSTRE/tests:/sbin:/usr/sbin;\
+ cd $RPWD; LUSTRE=\"$RLUSTRE\" bash -c \"$@\")" |
+ sed -e "s/^/${HOSTNAME}: /"
+ else
+ $myPDSH $HOST \
+ "(PATH=\$PATH:$RLUSTRE/utils:$RLUSTRE/tests:/sbin:/usr/sbin;\
+ cd $RPWD; LUSTRE=\"$RLUSTRE\" bash -c \"$@\")"
+ fi
+ else
+ $myPDSH $HOST \
+ "(PATH=\$PATH:$RLUSTRE/utils:$RLUSTRE/tests:/sbin:/usr/sbin;\
+ cd $RPWD; LUSTRE=\"$RLUSTRE\" bash -c \"$@\")" |
+ sed "s/^${HOST}: //"
+ fi
+ return ${PIPESTATUS[0]}
}
single_local_node () {
# do not replace anything from pdsh output if -N is used
# -N Disable hostname: prefix on lines of output.
if [[ -n "$verbose" || $myPDSH = *-N* ]]; then
- $myPDSH $rnodes "(PATH=\$PATH:$RLUSTRE/utils:$RLUSTRE/tests:/sbin:/usr/sbin; cd $RPWD; LUSTRE=\"$RLUSTRE\" $(get_env_vars) sh -c \"$@\")"
+ $myPDSH $rnodes "(PATH=\$PATH:$RLUSTRE/utils:$RLUSTRE/tests:/sbin:/usr/sbin; cd $RPWD; LUSTRE=\"$RLUSTRE\" $(get_env_vars) bash -c \"$@\")"
else
- $myPDSH $rnodes "(PATH=\$PATH:$RLUSTRE/utils:$RLUSTRE/tests:/sbin:/usr/sbin; cd $RPWD; LUSTRE=\"$RLUSTRE\" $(get_env_vars) sh -c \"$@\")" | sed -re "s/^[^:]*: //g"
+ $myPDSH $rnodes "(PATH=\$PATH:$RLUSTRE/utils:$RLUSTRE/tests:/sbin:/usr/sbin; cd $RPWD; LUSTRE=\"$RLUSTRE\" $(get_env_vars) bash -c \"$@\")" | sed -re "s/^[^:]*: //g"
fi
return ${PIPESTATUS[0]}
}