MDT0=$($LCTL get_param -n mdc.*.mds_server_uuid |
awk '{ gsub(/_UUID/,""); print $1 }' | head -n1)
-LOVNAME=$($LCTL get_param -n llite.*.lov.common_name | tail -n 1)
-OSTCOUNT=$($LCTL get_param -n lov.$LOVNAME.numobd)
-STRIPECOUNT=$($LCTL get_param -n lov.$LOVNAME.stripecount)
-STRIPESIZE=$($LCTL get_param -n lov.$LOVNAME.stripesize)
-ORIGFREE=$($LCTL get_param -n lov.$LOVNAME.kbytesavail)
MAXFREE=${MAXFREE:-$((200000 * $OSTCOUNT))}
[ -f $DIR/d52a/foo ] && chattr -a $DIR/d52a/foo
test_24x() {
[[ $MDSCOUNT -lt 2 ]] && skip "needs >= 2 MDTs" && return
+
+ [[ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.7.56) ]] &&
+ skip "Need MDS version at least 2.7.56" && return
+
[ $PARALLEL == "yes" ] && skip "skip parallel run" && return
local MDTIDX=1
local remote_dir=$DIR/$tdir/remote_dir
test_27m() {
[[ $OSTCOUNT -lt 2 ]] && skip_env "$OSTCOUNT < 2 OSTs -- skipping" &&
return
+
+ ORIGFREE=$($LCTL get_param -n lov.$FSNAME-clilov-*.kbytesavail |
+ head -n1)
if [[ $ORIGFREE -gt $MAXFREE ]]; then
skip "$ORIGFREE > $MAXFREE skipping out-of-space test on OST0"
return
local file_size=$((stripe_size * OSTCOUNT))
local file_num=$((NUMDIRS * NUMFILES + NUMFILES))
local required_space=$((file_num * file_size))
- local free_space=$($LCTL get_param -n lov.$LOVNAME.kbytesavail)
+
+ local free_space=$($LCTL get_param -n lov.$FSNAME-clilov-*.kbytesavail |
+ head -n1)
[[ $free_space -le $((required_space / 1024)) ]] &&
skip_env "need at least $required_space bytes free space," \
"have $free_space kbytes" && return
test_60b() { # bug 6411
[ $PARALLEL == "yes" ] && skip "skip parallel run" && return
dmesg > $DIR/$tfile
- LLOG_COUNT=`dmesg | awk "/$TEST60_HEAD/{marker = 1; from_marker = 0;}
- /llog.test/ {
- if (marker)
- from_marker++
- from_begin++
- }
- END {
- if (marker)
- print from_marker
- else
- print from_begin
- }"`
- [[ $LLOG_COUNT -gt 50 ]] &&
+ LLOG_COUNT=$(dmesg | awk "/$TEST60_HEAD/ { marker = 1; from_marker = 0; }
+ /llog.test/ {
+ if (marker)
+ from_marker++
+ from_begin++
+ }
+ END {
+ if (marker)
+ print from_marker
+ else
+ print from_begin
+ }")
+ [[ $LLOG_COUNT -gt 100 ]] &&
error "CDEBUG_LIMIT not limiting messages ($LLOG_COUNT)" || true
}
run_test 60b "limit repeated messages from CERROR/CWARN ========"
test_65b() {
[ $PARALLEL == "yes" ] && skip "skip parallel run" && return
test_mkdir -p $DIR/$tdir
+ local STRIPESIZE=$($GETSTRIPE -S $DIR/$tdir)
+
$SETSTRIPE -S $((STRIPESIZE * 2)) -i 0 -c 1 $DIR/$tdir ||
error "setstripe"
touch $DIR/$tdir/f2
$LVERIFY $DIR/$tdir $DIR/$tdir/f2 || error "lverify failed"
}
-run_test 65b "directory setstripe -S $((STRIPESIZE * 2)) -i 0 -c 1"
+run_test 65b "directory setstripe -S stripe_size*2 -i 0 -c 1"
test_65c() {
[ $PARALLEL == "yes" ] && skip "skip parallel run" && return
if [[ $OSTCOUNT -gt 1 ]]; then
test_mkdir -p $DIR/$tdir
+ local STRIPESIZE=$($GETSTRIPE -S $DIR/$tdir)
+
$SETSTRIPE -S $(($STRIPESIZE * 4)) -i 1 \
-c $(($OSTCOUNT - 1)) $DIR/$tdir || error "setstripe"
touch $DIR/$tdir/f3
$LVERIFY $DIR/$tdir $DIR/$tdir/f3 || error "lverify failed"
fi
}
-run_test 65c "directory setstripe -S $((STRIPESIZE*4)) -i 1 -c $((OSTCOUNT-1))"
+run_test 65c "directory setstripe -S stripe_size*4 -i 1 -c $((OSTCOUNT-1))"
test_65d() {
[ $PARALLEL == "yes" ] && skip "skip parallel run" && return
test_mkdir -p $DIR/$tdir
+ local STRIPECOUNT=$($GETSTRIPE -c $DIR/$tdir)
+ local STRIPESIZE=$($GETSTRIPE -S $DIR/$tdir)
+
if [[ $STRIPECOUNT -le 0 ]]; then
sc=1
elif [[ $STRIPECOUNT -gt 2000 ]]; then
$LVERIFY $DIR/$tdir $DIR/$tdir/f4 $DIR/$tdir/f5 ||
error "lverify failed"
}
-run_test 65d "directory setstripe -S $STRIPESIZE -c stripe_count"
+run_test 65d "directory setstripe -S stripe_size -c stripe_count"
test_65e() {
[ $PARALLEL == "yes" ] && skip "skip parallel run" && return
test_65g() {
[ $PARALLEL == "yes" ] && skip "skip parallel run" && return
test_mkdir -p $DIR/$tdir
+ local STRIPESIZE=$($GETSTRIPE -S $DIR/$tdir)
+
$SETSTRIPE -S $((STRIPESIZE * 2)) -i 0 -c 1 $DIR/$tdir ||
error "setstripe"
$SETSTRIPE -d $DIR/$tdir || error "setstripe"
test_65h() {
[ $PARALLEL == "yes" ] && skip "skip parallel run" && return
test_mkdir -p $DIR/$tdir
+ local STRIPESIZE=$($GETSTRIPE -S $DIR/$tdir)
+
$SETSTRIPE -S $((STRIPESIZE * 2)) -i 0 -c 1 $DIR/$tdir ||
error "setstripe"
test_mkdir -p $DIR/$tdir/dd1
# some versions of cvs import exit(1) when asked to import links or
# files they can't read. ignore those files.
TOIGNORE=$(find . -type l -printf '-I %f\n' -o \
- ! -perm +4 -printf '-I %f\n')
+ ! -perm /4 -printf '-I %f\n')
$RUNAS cvs -d $DIR/d99cvsroot import -m "nomesg" $TOIGNORE \
d99reposname vtag rtag
}
}
run_test 133e "Verifying OST {read,write}_bytes nid stats ================="
-test_133f() {
- local proc_dirs
-
- local dirs="/proc/fs/lustre/ /proc/sys/lnet/ /proc/sys/lustre/ \
-/sys/fs/lustre/ /sys/fs/lnet/"
- local dir
- for dir in $dirs; do
- if [ -d $dir ]; then
- proc_dirs="$proc_dirs $dir"
- fi
- done
-
- local facet
+proc_dirs=""
+for dir in /proc/fs/lustre/ /proc/sys/lnet/ /proc/sys/lustre/ \
+ /sys/fs/lustre/ /sys/fs/lnet/ /sys/kernel/debug/lustre/; do
+ [[ -d $dir ]] && proc_dirs+=" $dir"
+done
+test_133f() {
remote_mds_nodsh && skip "remote MDS with nodsh" && return
remote_ost_nodsh && skip "remote OST with nodsh" && return
# First without trusting modes.
find $proc_dirs -exec cat '{}' \; &> /dev/null
# Second verifying readability.
- find $proc_dirs \
- -type f \
- -exec cat '{}' \; &> /dev/null ||
- error "proc file read failed"
+ $LCTL get_param -R &> /dev/null || error "proc file read failed"
+ # eventually, this can also be replaced with "lctl get_param -R",
+ # but not until that option is always available on the server
+ local facet
for facet in $SINGLEMDS ost1; do
do_facet $facet find $proc_dirs \
! -name req_history \
run_test 133f "Check for LBUGs/Oopses/unreadable files in /proc"
test_133g() {
- local proc_dirs
-
- local dirs="/proc/fs/lustre/ /proc/sys/lnet/ /proc/sys/lustre/ \
-/sys/fs/lustre/ /sys/fs/lnet/"
- local dir
- for dir in $dirs; do
- if [ -d $dir ]; then
- proc_dirs="$proc_dirs $dir"
- fi
- done
-
- local facet
-
- # Second verifying readability.
+ # Second verifying writability.
find $proc_dirs \
-type f \
-not -name force_lbug \
[ $(lustre_version_code ost1) -le $(version_code 2.5.54) ] &&
skip "Too old lustre on ost1" && return
+ local facet
for facet in $SINGLEMDS ost1; do
do_facet $facet find $proc_dirs \
-type f \
}
run_test 230g "migrate dir to non-exist MDT"
+test_230h() {
+ [ $PARALLEL == "yes" ] && skip "skip parallel run" && return
+ [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return
+ [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.7.64) ] &&
+ skip "Need MDS version at least 2.7.64" && return
+ local mdt_index
+
+ mkdir -p $DIR/$tdir/migrate_dir
+
+ $LFS migrate -m1 $DIR &&
+ error "migrating mountpoint1 should fail"
+
+ $LFS migrate -m1 $DIR/$tdir/.. &&
+ error "migrating mountpoint2 should fail"
+
+ $LFS migrate -m1 $DIR/$tdir/migrate_dir/.. ||
+ error "migrating $tdir fail"
+
+ mdt_index=$($LFS getstripe -M $DIR/$tdir)
+ [ $mdt_index == 1 ] || error "$mdt_index != 1 after migration"
+
+ mdt_index=$($LFS getstripe -M $DIR/$tdir/migrate_dir)
+ [ $mdt_index == 1 ] || error "$mdt_index != 1 after migration"
+
+}
+run_test 230h "migrate .. and root"
+
test_231a()
{
# For simplicity this test assumes that max_pages_per_rpc
# clear the OSC stats
$LCTL set_param osc.*.stats=0 &>/dev/null
+ stop_writeback
# Client writes $bulk_size - there must be 1 rpc for $max_pages.
dd if=/dev/zero of=$DIR/$tdir/$tfile bs=$bulk_size count=1 \
oflag=direct &>/dev/null || error "dd failed"
+ sync; sleep 1; sync # just to be safe
local nrpcs=$($LCTL get_param osc.*.stats |awk '/ost_write/ {print $2}')
if [ x$nrpcs != "x1" ]; then
- error "found $nrpc ost_write RPCs, not 1 as expected"
+ $LCTL get_param osc.*.stats
+ error "found $nrpcs ost_write RPCs, not 1 as expected"
fi
+ start_writeback
# Drop the OSC cache, otherwise we will read from it
cancel_lru_locks osc
nrpcs=$($LCTL get_param osc.*.stats | awk '/ost_read/ { print $2 }')
if [ x$nrpcs != "x1" ]; then
- error "found $nrpc ost_read RPCs, not 1 as expected"
+ $LCTL get_param osc.*.stats
+ error "found $nrpcs ost_read RPCs, not 1 as expected"
fi
}
run_test 231a "checking that reading/writing of BRW RPC size results in one RPC"
test_241_bio() {
for LOOP in $(seq $1); do
dd if=$DIR/$tfile of=/dev/null bs=40960 count=1 2>/dev/null
- cancel_lru_locks osc
+ cancel_lru_locks osc || true
done
}
error "create striped directory should fail"
[ -e $DIR/$tdir/bad_striped_dir ] && error "striped dir exists"
+
+ $LFS setdirstripe -c2 $DIR/$tdir/bad_striped_dir
true
}
run_test 300p "create striped directory without space"
run_test 400b "packaged headers can be compiled"
test_401() { #LU-7437
- local params
- local procs
-
#count the number of parameters by "list_param -R"
- params=$($LCTL list_param -R '*' 2>/dev/null | wc -l)
+ local params=$($LCTL list_param -R '*' 2>/dev/null | wc -l)
#count the number of parameters by listing proc files
- ls -lRL /proc/{fs,sys}/{lnet,lustre} 2>/dev/null |
- grep -v "^t" | grep -v "^d" > $TMP/$tfile
- #Since there is no /proc/fs/lnet, we need to remove other
- #3 directories, /proc/{fs,sys}/lustre and /proc/sys/lnet.
- procs=$(($(sed /^$/d $TMP/$tfile | wc -l)-3))
+ local procs=$(find -L $proc_dirs -mindepth 1 2>/dev/null | wc -l)
[ $params -eq $procs ] ||
error "found $params parameters vs. $procs proc files"
-
- rm -f $TMP/$tfile
}
run_test 401 "Verify if 'lctl list_param -R' can list parameters recursively"
+test_402() {
+ $LFS setdirstripe -i 0 $DIR/$tdir || error "setdirstripe -i 0 failed"
+#define OBD_FAIL_MDS_FLD_LOOKUP 0x15c
+ do_facet mds1 "lctl set_param fail_loc=0x8000015c"
+ touch $DIR/$tdir/$tfile && error "touch should fail with ENOENT" ||
+ echo "Touch failed - OK"
+}
+run_test 402 "Return ENOENT to lod_generate_and_set_lovea"
+
#
# tests that do cleanup/setup should be run at the end
#