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-13535 lfsck: fix possible PFL layout corruption
[fs/lustre-release.git]
/
lustre
/
tests
/
oos2.sh
diff --git
a/lustre/tests/oos2.sh
b/lustre/tests/oos2.sh
index
1eb5dbd
..
64a0f35
100644
(file)
--- a/
lustre/tests/oos2.sh
+++ b/
lustre/tests/oos2.sh
@@
-2,8
+2,13
@@
set -e
set -e
-export PATH=`dirname $0`/../utils:$PATH
+LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)}
+. $LUSTRE/tests/test-framework.sh
+. ${CONFIG:=$LUSTRE/tests/cfg/${NAME}.sh}
+
+export PATH=$LUSTRE/utils:$PATH
LFS=${LFS:-lfs}
LFS=${LFS:-lfs}
+LCTL=${LCTL:-lctl}
MOUNT=${MOUNT:-$1}
MOUNT=${MOUNT:-/mnt/lustre}
MOUNT2=${MOUNT2:-$2}
MOUNT=${MOUNT:-$1}
MOUNT=${MOUNT:-/mnt/lustre}
MOUNT2=${MOUNT2:-$2}
@@
-11,7
+16,7
@@
MOUNT2=${MOUNT2:-${MOUNT}2}
OOS=$MOUNT/oosfile
OOS2=$MOUNT2/oosfile2
TMP=${TMP:-/tmp}
OOS=$MOUNT/oosfile
OOS2=$MOUNT2/oosfile2
TMP=${TMP:-/tmp}
-LOG=$TMP/
oosfile
+LOG=$TMP/
$(basename $0 .sh).log
LOG2=${LOG}2
SUCCESS=1
LOG2=${LOG}2
SUCCESS=1
@@
-20,21
+25,20
@@
rm -f $OOS $OOS2 $LOG $LOG2
sync; sleep 1; sync # to ensure we get up-to-date statfs info
sync; sleep 1; sync # to ensure we get up-to-date statfs info
-STRIPECOUNT=`
cat /proc/fs/lustre/lov/*/
activeobd | head -n 1`
-ORIGFREE=`
cat /proc/fs/lustre/llite/*/
kbytesavail | head -n 1`
+STRIPECOUNT=`
$LCTL get_param -n lov.*.
activeobd | head -n 1`
+ORIGFREE=`
$LCTL get_param -n llite.*.
kbytesavail | head -n 1`
MAXFREE=${MAXFREE:-$((400000 * $STRIPECOUNT))}
MAXFREE=${MAXFREE:-$((400000 * $STRIPECOUNT))}
+echo STRIPECOUNT=$STRIPECOUNT ORIGFREE=$ORIGFREE MAXFREE=$MAXFREE
if [ $ORIGFREE -gt $MAXFREE ]; then
if [ $ORIGFREE -gt $MAXFREE ]; then
- echo "skipping out-of-space test on $OSC"
- echo "reports ${ORIGFREE}kB free, more tham MAXFREE ${MAXFREE}kB"
- echo "increase $MAXFREE (or reduce test fs size) to proceed"
+ skip "$0: ${ORIGFREE}kB free gt MAXFREE ${MAXFREE}kB, increase $MAXFREE (or reduce test fs size) to proceed"
exit 0
fi
export LANG=C LC_LANG=C # for "No space left on device" message
# make sure we stripe over all OSTs to avoid OOS on only a subset of OSTs
exit 0
fi
export LANG=C LC_LANG=C # for "No space left on device" message
# make sure we stripe over all OSTs to avoid OOS on only a subset of OSTs
-$LFS setstripe $OOS
65536 -1
$STRIPECOUNT
-$LFS setstripe $OOS2
65536 -1
$STRIPECOUNT
+$LFS setstripe $OOS
-c
$STRIPECOUNT
+$LFS setstripe $OOS2
-c
$STRIPECOUNT
dd if=/dev/zero of=$OOS count=$((3 * $ORIGFREE / 4 + 100)) bs=1k 2>> $LOG &
DDPID=$!
if dd if=/dev/zero of=$OOS2 count=$((3*$ORIGFREE/4 + 100)) bs=1k 2>> $LOG2; then
dd if=/dev/zero of=$OOS count=$((3 * $ORIGFREE / 4 + 100)) bs=1k 2>> $LOG &
DDPID=$!
if dd if=/dev/zero of=$OOS2 count=$((3*$ORIGFREE/4 + 100)) bs=1k 2>> $LOG2; then
@@
-46,22
+50,19
@@
if wait $DDPID; then
SUCCESS=0
fi
SUCCESS=0
fi
+[ ! -s "$LOG" ] && error "LOG file is empty!"
+[ ! -s "$LOG2" ] && error "LOG2 file is empty!"
+
if [ "`cat $LOG $LOG2 | grep -c 'No space left on device'`" -ne 2 ]; then
if [ "`cat $LOG $LOG2 | grep -c 'No space left on device'`" -ne 2 ]; then
-
echo "ERROR: dd not return ENOSPC"
+ echo "ERROR: dd not return ENOSPC"
SUCCESS=0
fi
# flush cache to OST(s) so avail numbers are correct
sync; sleep 1 ; sync
SUCCESS=0
fi
# flush cache to OST(s) so avail numbers are correct
sync; sleep 1 ; sync
-for OSC in /proc/fs/lustre/osc/*-osc-*; do
- AVAIL=`cat $OSC/kbytesavail`
- GRANT=`cat $OSC/cur_grant_bytes`
- [ $(($AVAIL - $GRANT / 1024)) -lt 400 ] && OSCFULL=full
-done
-if [ -z "$OSCFULL" ]; then
+if ! oos_full; then
echo "no OSTs are close to full"
echo "no OSTs are close to full"
- grep "[0-9]" /proc/fs/lustre/osc/*-osc-*/{kbytesavail,cur*}|tee -a $LOG
SUCCESS=0
fi
SUCCESS=0
fi
@@
-74,7
+75,11
@@
if [ "$RECORDSOUT" -ne $(($FILESIZE / 1024)) ]; then
SUCCESS=0
fi
SUCCESS=0
fi
+echo LOG LOG2 file
+cat $LOG $LOG2
+
rm -f $OOS $OOS2
rm -f $OOS $OOS2
+sync; sleep 1; sync
if [ $SUCCESS -eq 1 ]; then
echo "Success!"
if [ $SUCCESS -eq 1 ]; then
echo "Success!"