From aaf1d83ac7a5675f73faaf6bec4c9cfd9d3f7cbc Mon Sep 17 00:00:00 2001 From: adilger Date: Fri, 4 Oct 2002 08:45:36 +0000 Subject: [PATCH] A script along the lines of runregression-net.sh and runregression-brw.sh, which is rather simple-minded in its operations, but does lots of them. --- lustre/tests/runregression-mds.sh | 65 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100755 lustre/tests/runregression-mds.sh diff --git a/lustre/tests/runregression-mds.sh b/lustre/tests/runregression-mds.sh new file mode 100755 index 0000000..4a60a54 --- /dev/null +++ b/lustre/tests/runregression-mds.sh @@ -0,0 +1,65 @@ +#!/bin/sh + +SRCDIR="`dirname $0`" + +ENDRUN=endrun-`hostname` + +fail() { + echo "ERROR: $1" 1>&2 + [ $2 ] && RC=$2 || RC=1 + exit $RC +} + +export PATH=/sbin:/usr/sbin:$SRCDIR:$PATH + +cleanup() { + trap 0 + $LCONF --cleanup $OPTS +} + +[ "$COUNT" ] || COUNT=1000 + +[ "$LCONF" ] || LCONF=$SRCDIR/../utils/lconf + +[ -z "$*" ] && fail "usage: $0 [--reformat] .xml" 1 + +OSCMT="`mount | awk '/ lustre_lite / { print $3 }' | tail -1`" +if [ -z "$OSCMT" ]; then + $LCONF $@ || exit 1 + trap cleanup 0 + OSCMT="`mount | awk '/ lustre_lite / { print $3 }' | tail -1`" + [ -z "$OSCMT" ] && fail "no lustre filesystem mounted" 1 +fi + +while [ "$1" ]; do + case $1 in + -v|--verbose) V=-v;; + --reformat) : ;; + *) OPTS="$OPTS $1" ;; + esac + shift +done + +OSCTMP=`echo $OSCMT | tr "/" "."` +USED=`df | awk "/$OSCTMP/ { print \\$3 }" | tail -1` +USED=`expr $USED + 16` # Some space for the status file + +THREADS=1 +while [ ! -f $ENDRUN ]; do + echo "starting $THREADS threads at `date`" + echo 0 > /proc/sys/portals/debug + $SRCDIR/createdestroy /mnt/lustre/file-$$ $COUNT -10 $THREADS + THREADS=`expr $THREADS + 1` + $LCONF --cleanup $OPTS || fail 10 + $LCONF $OPTS || fail 11 +done + +rm -f $ENDRUN + +NOWUSED=`df | awk "/$OSCTMP/ { print \\$3 }" | tail -1` +if [ $NOWUSED -gt $USED ]; then + echo "Space not all freed: now ${NOWUSED}kB, was ${USED}kB." 1>&2 + echo "This is normal on BA OSTs, because of subdirectories." 1>&2 +fi + +cleanup -- 1.8.3.1