Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LU-482 tests: cleanup clients/OSTs after MDS error
[fs/lustre-release.git]
/
lustre
/
tests
/
mdsrate-create-small.sh
diff --git
a/lustre/tests/mdsrate-create-small.sh
b/lustre/tests/mdsrate-create-small.sh
index
4babb26
..
59b33a6
100644
(file)
--- a/
lustre/tests/mdsrate-create-small.sh
+++ b/
lustre/tests/mdsrate-create-small.sh
@@
-1,4
+1,4
@@
-#!/bin/bash
+
#!/bin/bash
#
# This test was used in a set of CMD3 tests (cmd3-3 test).
#
# This test was used in a set of CMD3 tests (cmd3-3 test).
@@
-10,15
+10,15
@@
init_test_env $@
assert_env CLIENTS MDSRATE SINGLECLIENT MPIRUN
MACHINEFILE=${MACHINEFILE:-$TMP/$(basename $0 .sh).machines}
assert_env CLIENTS MDSRATE SINGLECLIENT MPIRUN
MACHINEFILE=${MACHINEFILE:-$TMP/$(basename $0 .sh).machines}
-TESTDIR=$MOUNT
+BASEDIR=$MOUNT/mdsrate
# Requirements
NUM_FILES=${NUM_FILES:-1000000}
TIME_PERIOD=${TIME_PERIOD:-600} # seconds
# Local test variables
# Requirements
NUM_FILES=${NUM_FILES:-1000000}
TIME_PERIOD=${TIME_PERIOD:-600} # seconds
# Local test variables
-TESTDIR_SINGLE="${
TEST
DIR}/single"
-TESTDIR_MULTI="${
TEST
DIR}/multi"
+TESTDIR_SINGLE="${
BASE
DIR}/single"
+TESTDIR_MULTI="${
BASE
DIR}/multi"
LOG=${TESTSUITELOG:-$TMP/$(basename $0 .sh).log}
CLIENT=$SINGLECLIENT
LOG=${TESTSUITELOG:-$TMP/$(basename $0 .sh).log}
CLIENT=$SINGLECLIENT
@@
-34,22
+34,24
@@
fi
[ ! -x ${MDSRATE} ] && error "${MDSRATE} not built."
# Make sure we start with a clean slate
[ ! -x ${MDSRATE} ] && error "${MDSRATE} not built."
# Make sure we start with a clean slate
-rm -f ${LOG}
PI*
+rm -f ${LOG}
log "===== $0 ====== "
check_and_setup_lustre
log "===== $0 ====== "
check_and_setup_lustre
-IFree=$(inodes_available)
+mkdir -p $BASEDIR
+chmod 0777 $BASEDIR
+$LFS setstripe $BASEDIR -i 0 -c 1
+get_stripe $BASEDIR
+
+IFree=$(mdsrate_inodes_available)
if [ $IFree -lt $NUM_FILES ]; then
NUM_FILES=$IFree
fi
generate_machine_file $NODES_TO_USE $MACHINEFILE || error "can not generate machinefile"
if [ $IFree -lt $NUM_FILES ]; then
NUM_FILES=$IFree
fi
generate_machine_file $NODES_TO_USE $MACHINEFILE || error "can not generate machinefile"
-$LFS setstripe $TESTDIR -i 0 -c 1
-get_stripe $TESTDIR
-
if [ -n "$NOSINGLE" ]; then
echo "NO Tests on single client."
else
if [ -n "$NOSINGLE" ]; then
echo "NO Tests on single client."
else
@@
-78,7
+80,7
@@
else
log "===== $0 ### 1 NODE UNLINK ###"
if [ -f "$LOG" ]; then
log "===== $0 ### 1 NODE UNLINK ###"
if [ -f "$LOG" ]; then
- CREATED=$(
awk '/total:/ { print $7 }
' $LOG)
+ CREATED=$(
sed -n '/^Rate:/s/^.* \([0-9]*\) creates .*/\1/p
' $LOG)
[ $CREATED -gt 0 ] && NUM_FILES=$CREATED
fi
[ $CREATED -gt 0 ] && NUM_FILES=$CREATED
fi
@@
-91,10
+93,12
@@
else
[ -f $LOG ] && sed -e "s/^/log: /" $LOG
error "mdsrate unlinks for a single client failed, aborting"
fi
[ -f $LOG ] && sed -e "s/^/log: /" $LOG
error "mdsrate unlinks for a single client failed, aborting"
fi
+
+ rmdir $TESTDIR_SINGLE
fi
fi
fi
fi
-IFree=$(inodes_available)
+IFree=$(
mdsrate_
inodes_available)
if [ $IFree -lt $NUM_FILES ]; then
NUM_FILES=$IFree
fi
if [ $IFree -lt $NUM_FILES ]; then
NUM_FILES=$IFree
fi
@@
-126,7
+130,7
@@
else
log "===== $0 ### $NUM_CLIENTS NODES UNLINK with $THREADS_PER_CLIENT threads per client ###"
if [ -f "$LOG" ]; then
log "===== $0 ### $NUM_CLIENTS NODES UNLINK with $THREADS_PER_CLIENT threads per client ###"
if [ -f "$LOG" ]; then
- CREATED=$(
awk '/total:/ { print $7 }
' $LOG)
+ CREATED=$(
sed -n '/^Rate:/s/^.* \([0-9]*\) creates .*/\1/p
' $LOG)
[ $CREATED -gt 0 ] && NUM_FILES=$CREATED
fi
[ $CREATED -gt 0 ] && NUM_FILES=$CREATED
fi
@@
-139,10
+143,13
@@
else
[ -f $LOG ] && sed -e "s/^/log: /" $LOG
error "mdsrate unlinks multiple nodes failed, aborting"
fi
[ -f $LOG ] && sed -e "s/^/log: /" $LOG
error "mdsrate unlinks multiple nodes failed, aborting"
fi
+
+ rmdir $TESTDIR_MULTI
fi
fi
equals_msg `basename $0`: test complete, cleaning up
fi
fi
equals_msg `basename $0`: test complete, cleaning up
+rmdir $BASEDIR || true
rm -f $MACHINEFILE
check_and_cleanup_lustre
#rm -f $LOG
rm -f $MACHINEFILE
check_and_cleanup_lustre
#rm -f $LOG