X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Frundbench;h=11f619116dba6b00dd33ca6d6626f974f307c9d1;hb=02b6b6746af7e032df51001926fe1d59143520da;hp=c3fa9cb1e600296bdc31108a993849529e81cf70;hpb=f6796fea971503083308076ce78acfc385271ae4;p=fs%2Flustre-release.git diff --git a/lustre/tests/rundbench b/lustre/tests/rundbench index c3fa9cb..11f6191 100755 --- a/lustre/tests/rundbench +++ b/lustre/tests/rundbench @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)} . $LUSTRE/tests/test-framework.sh @@ -28,8 +28,8 @@ TGT=$DIR/client.txt CLIENT_PREFIX="${DBENCH_LIB} /usr/share/dbench /usr/local/share /usr/lib/dbench" CLIENT_FILE="client.txt client_plain.txt dbench_client" if ! which dbench > /dev/null 2>&1 ; then - [ "$MISSING_DBENCH_OK" ] || { error "dbench is not installed !" && exit 3; } - skip "$0: dbench is not installed" + [ "$MISSING_DBENCH_OK" ] || { error "$0 : $(hostname) dbench is not installed !" && exit 3; } + skip_env "$0 : $(hostname) dbench is not installed" exit 0 fi CLIENT="" @@ -44,24 +44,30 @@ for prefix in $CLIENT_PREFIX; do [ "x$CLIENT" != "x" ] && break; done -if [ -n "$SRC" -a -s "$SRC" ]; then - CLIENT=${SRC} +if [ -n "$DBENCH_SRC" -a -s "$DBENCH_SRC" ]; then + CLIENT=$DBENCH_SRC fi -[ ! -s "$CLIENT" ] && \ - skip "$0: no client file found for dbench DBENCH_LIB=$DBENCH_LIB SRC=$SRC" && \ - exit 0 +[ ! -s "$CLIENT" ] && + skip_env "$0: no client file found for dbench on $(hostname): "\ + "DBENCH_LIB=$DBENCH_LIB DBENCH_SRC=$DBENCH_SRC" && exit 0 [ ! -s "$TGT" ] && echo "copying $CLIENT to $TGT" && cp $CLIENT $TGT [ ! -s "$TGT" ] && \ - echo "$0: $TGT file doesn't exist after cp $CLIENT $TGT" && exit 1 + echo "$0 : $(hostname) $TGT file doesn't exist after cp $CLIENT $TGT" && exit 1 if [ "x$CHROOT" == "xyes" ]; then echo "copying necessary libs to $DIR" cp `which dbench` $DIR - LIBS71=$(ldd $DIR/dbench|sed -e 's/\t*//' -e 's/.*=> //' -e 's/ .*//' -e 's/^\///') - (cd / && tar chf - $LIBS71) | (cd $DIR && tar xvf -) - [ $? != 0 ] && echo "can't copy libs $LIBS71 to $DIR" && exit 1 + LIBS71=$(ldd $DIR/dbench | + sed -e 's/\t*//' -e 's/.*=> //' -e 's/ .*//' -e 's/^\///' | + grep -v 'linux-vdso.so.1') + tar -C / -chf - $LIBS71 | tar -C $DIR -xvf - + if [ "${PIPESTATUS[*]}" != "0 0" ]; then + echo "can't copy libs $LIBS71 to $DIR" + rm -f $DIR/dbench + exit 1 + fi RUN="chroot $DIR" PREFIX="in" PATH=.:/:$PATH @@ -76,6 +82,10 @@ rm -rf dbench $LIBS71 client.txt exit 0 ' TERM +# turn off errexit. rundbench will return error code on failure +trap '' ERR +set +e + cd $DIR echo "running 'dbench $@' $PREFIX $PWD at `date`"