X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Fllmountcleanup.sh;h=454ed6eecc801b68a7f2b599a94e6a8968ad7324;hb=5a28f3bc4bd769d61dde54fdbf7ad11a16b47224;hp=05ac8a4f545e6431c016e4bbb33c11d778490af9;hpb=191061ee668400324f4505cf498f1ee2d57e4962;p=fs%2Flustre-release.git diff --git a/lustre/tests/llmountcleanup.sh b/lustre/tests/llmountcleanup.sh index 05ac8a4..454ed6e 100755 --- a/lustre/tests/llmountcleanup.sh +++ b/lustre/tests/llmountcleanup.sh @@ -1,55 +1,7 @@ -#!/bin/sh +#!/bin/bash -export PATH=`dirname $0`/../utils:$PATH +LUSTRE=${LUSTRE:-$(dirname $0)/..} +. $LUSTRE/tests/test-framework.sh +init_test_env $@ -LCONF=${LCONF:-lconf} -NAME=${NAME:-local} -TMP=${TMP:-/tmp} - -config=$NAME.xml -mkconfig=$NAME.sh - -if [ "$PORTALS" ]; then - portals_opt="--portals=$PORTALS" -fi - -if [ "$LUSTRE" ]; then - lustre_opt="--lustre=$LUSTRE" -fi - -if [ "$LDAPURL" ]; then - conf_opt="--ldapurl $LDAPURL --config $NAME" -else - if [ ! -f $config ]; then - sh $mkconfig $config || exit 1 - fi - conf_opt="$config" -fi - -[ "$NODE" ] && node_opt="--node $NODE" - -sync; sleep 2; sync - -[ "$MOUNT2" ] && umount $MOUNT2 - -${LCONF} $NOMOD $portals_opt $lustre_opt $node_opt --cleanup $@ \ - --dump $TMP/debug $conf_opt -rc=$? -echo "lconf DONE" -BUSY=`dmesg | grep -i destruct` -if [ "$BUSY" ]; then - echo "$BUSY" 1>&2 - mv $TMP/debug $TMP/debug-busy.`date +%s` - exit 255 -fi -LEAK_LUSTRE=`dmesg | tail -n 30 | grep "obd mem.*leaked"` -LEAK_PORTALS=`dmesg | tail -n 20 | grep "Portals memory leaked"` -if [ "$LEAK_LUSTRE" -o "$LEAK_PORTALS" ]; then - echo "$LEAK_LUSTRE" 1>&2 - echo "$LEAK_PORTALS" 1>&2 - mv $TMP/debug $TMP/debug-leak.`date +%s` - exit 254 -fi -lsmod | grep portals && echo "modules still loaded" && exit 1 - -exit $rc +cleanupall -f