Whamcloud - gitweb
Merge b_md to HEAD for 0.5.19 release.
[fs/lustre-release.git] / lustre / tests / llmountcleanup.sh
1 #!/bin/sh
2
3 LCONF=${LCONF:-../utils/lconf}
4 NAME=${NAME:-local}
5 TMP=${TMP:-/tmp}
6
7 config=$NAME.xml
8 mkconfig=./$NAME.sh
9
10 if [ ! -f $config ]; then
11    sh $mkconfig $config || exit 1
12 fi
13
14 sync; sleep 2; sync
15 ${LCONF} --cleanup --dump $TMP/debug $config
16 BUSY=`dmesg | grep -i destruct`
17 if [ "$BUSY" ]; then
18         echo "$BUSY" 1>&2
19         mv $TMP/debug $TMP/debug-busy.`date +%s`
20         exit -1
21 fi
22 LEAK_LUSTRE=`dmesg | tail -20 | grep -v "leaked: 0" | grep leaked`
23 LEAK_PORTALS=`dmesg | tail -20 | grep "Portals memory leaked"`
24 if [ "$LEAK_LUSTRE" -o "$LEAK_PORTALS" ]; then
25         echo "$LEAK_LUSTRE" 1>&2
26         echo "$LEAK_PORTALS" 1>&2
27         mv $TMP/debug $TMP/debug-leak.`date +%s`
28         exit -2
29 fi