# bug number for skipped tests: LU-2036
ALWAYS_EXCEPT=" 76 $ALWAYS_EXCEPT"
+is_sles11() # LU-4341
+{
+ if [ -r /etc/SuSE-release ]
+ then
+ local vers=$(grep VERSION /etc/SuSE-release | awk '{print $3}')
+ local patchlev=$(grep PATCHLEVEL /etc/SuSE-release |
+ awk '{ print $3 }')
+ if [ $vers -eq 11 ] && [ $patchlev -ge 3 ]; then
+ return 0
+ fi
+ fi
+ return 1
+}
+
+if is_sles11; then # LU-4341
+ ALWAYS_EXCEPT="$ALWAYS_EXCEPT 170"
+fi
+
SRCDIR=$(cd $(dirname $0); echo $PWD)
export PATH=$PATH:/sbin
MEMHOG=${MEMHOG:-memhog}
DIRECTIO=${DIRECTIO:-directio}
ACCEPTOR_PORT=${ACCEPTOR_PORT:-988}
-UMOUNT=${UMOUNT:-"umount -d"}
STRIPES_PER_OBJ=-1
CHECK_GRANT=${CHECK_GRANT:-"yes"}
GRANT_CHECK_LIST=${GRANT_CHECK_LIST:-""}
. ${CONFIG:=$LUSTRE/tests/cfg/${NAME}.sh}
init_logging
-[ "$SLOW" = "no" ] && EXCEPT_SLOW="24o 24D 27m 64b 68 71 77f 78 115 124b"
+[ "$SLOW" = "no" ] && EXCEPT_SLOW="24o 24D 27m 64b 68 71 77f 78 115 124b 300o"
if [ $(facet_fstype $SINGLEMDS) = "zfs" ]; then
# bug number for skipped test: LU-4536 LU-1957 LU-2805
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_17m() {
local short_sym="0123456789"
local WDIR=$DIR/${tdir}m
- local mds_index
- local devname
- local cmd
local i
- local rc=0
remote_mds_nodsh && skip "remote MDS with nodsh" && return
[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.2.0) ] &&
echo "recreate the 512 symlink files with a shorter string"
for ((i = 0; i < 512; ++i)); do
# rewrite the symlink file with a shorter string
- ln -sf ${long_sym} $WDIR/long-$i
- ln -sf ${short_sym} $WDIR/short-$i
+ ln -sf ${long_sym} $WDIR/long-$i || error "long_sym failed"
+ ln -sf ${short_sym} $WDIR/short-$i || error "short_sym failed"
done
- mds_index=$($LFS getstripe -M $WDIR)
- mds_index=$((mds_index+1))
- devname=$(mdsdevname $mds_index)
- cmd="$E2FSCK -fnvd $devname"
+ local mds_index=$(($($LFS getstripe -M $WDIR) + 1))
+ local devname=$(mdsdevname $mds_index)
- echo "stop and checking mds${mds_index}: $cmd"
+ echo "stop and checking mds${mds_index}:"
# e2fsck should not return error
stop mds${mds_index}
- do_facet mds${mds_index} $cmd || rc=$?
+ run_e2fsck $(facet_active_host mds${mds_index}) $devname -n
+ rc=$?
start mds${mds_index} $devname $MDS_MOUNT_OPTS || error "start failed"
df $MOUNT > /dev/null 2>&1
- [ $rc -ne 0 ] && error "e2fsck should not report error upon "\
- "short/long symlink MDT: rc=$rc"
- return $rc
+ [ $rc -eq 0 ] ||
+ error "e2fsck detected error for short/long symlink: rc=$rc"
}
run_test 17m "run e2fsck against MDT which contains short/long symlink"
check_fs_consistency_17n() {
local mdt_index
- local devname
- local cmd
local rc=0
# create/unlink in 17n only change 2 MDTs(MDT1/MDT2),
# so it only check MDT1/MDT2 instead of all of MDTs.
- for mdt_index in $(seq 1 2); do
- devname=$(mdsdevname $mdt_index)
- cmd="$E2FSCK -fnvd $devname"
-
- echo "stop and checking mds${mdt_index}: $cmd"
+ for mdt_index in 1 2; do
+ local devname=$(mdsdevname $mdt_index)
# e2fsck should not return error
stop mds${mdt_index}
- do_facet mds${mdt_index} $cmd || rc=$?
+ run_e2fsck $(facet_active_host mds$mdt_index) $devname -n ||
+ rc=$((rc + $?))
start mds${mdt_index} $devname $MDS_MOUNT_OPTS ||
- error "mount mds${mdt_index} failed"
+ error "mount mds$mdt_index failed"
df $MOUNT > /dev/null 2>&1
- [ $rc -ne 0 ] && break
done
return $rc
}
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
log "want: stripe:$stripe_nr ost:$obdidx oid:$oid/$hex seq:$seq"
seq=$(echo $seq | sed -e "s/^0x//g")
- if [ $seq == 0 ]; then
+ if [ $seq == 0 ] || [ $(facet_fstype ost$ost) == zfs ]; then
oid_hex=$(echo $oid)
else
oid_hex=$(echo $hex | sed -e "s/^0x//g")
$(facet_mntpt ost$ost)/$obj_file)
unmount_fstype ost$ost
start ost$ost $dev $OST_MOUNT_OPTS
+ clients_up
fi
[ -z "$ff" ] && error "$obj_file: no filter_fid info"
cleanup_test32_mount() {
trap 0
- $UMOUNT -d $DIR/$tdir/ext2-mountpoint
+ $UMOUNT $DIR/$tdir/ext2-mountpoint
}
test_32a() {
cleanup_testdir_mount() {
trap 0
- $UMOUNT -d $DIR/$tdir
+ $UMOUNT $DIR/$tdir
}
test_32q() {
error "create" || true
$RUNAS $OPENFILE -f O_RDWR:O_CREAT -m 0444 $remote_dir/f33 &&
error "open RDWR" || true
- $RUNAS $OPENFILE -f 1286739555 $remote_dir/f33 &&
- error "create" || true
+ $RUNAS $OPENFILE -f 1286739555 $remote_dir/f33 || true
}
run_test 33d "openfile with 444 modes and malformed flags under remote dir"
loopdev="$DIR/loop54c"
trap 0
- $UMOUNT -d $DIR/$tdir || rc=$?
+ $UMOUNT $DIR/$tdir || rc=$?
losetup -d $loopdev || true
losetup -d $LOOPDEV || true
rm -rf $loopdev $DIR/$tfile $DIR/$tdir
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
[ $PARALLEL == "yes" ] && skip "skip parallel run" && return
remote_mgs_nodsh && skip "remote MGS with nodsh" && return
do_facet mgs "! which run-llog.sh &> /dev/null" &&
- skip_env "missing subtest run-llog.sh" && return
+ do_facet mgs "! ls run-llog.sh &> /dev/null" &&
+ skip_env "missing subtest run-llog.sh" && return
+
log "$TEST60_HEAD - from kernel mode"
+ do_facet mgs "$LCTL set_param debug=warning; $LCTL dk > /dev/null"
do_facet mgs sh run-llog.sh
+ do_facet mgs $LCTL dk > $TMP/$tfile
+
+ # LU-6388: test llog_reader
+ local llog_reader=$(do_facet mgs "which llog_reader 2> /dev/null")
+ llog_reader=${llog_reader:-$LUSTRE/utils/llog_reader}
+ [ -z $(do_facet mgs ls -d $llog_reader 2> /dev/null) ] &&
+ skip_env "missing llog_reader" && return
+ local fstype=$(facet_fstype mgs)
+ [ $fstype != ldiskfs -a $fstype != zfs ] &&
+ skip_env "Only for ldiskfs or zfs type mgs" && return
+
+ local mntpt=$(facet_mntpt mgs)
+ local mgsdev=$(mgsdevname 1)
+ local fid_list
+ local fid
+ local rec_list
+ local rec
+ local rec_type
+ local obj_file
+ local path
+ local seq
+ local oid
+ local pass=true
+
+ #get fid and record list
+ fid_list=($(awk '/9_sub.*record/ { print $NF }' /$TMP/$tfile |
+ tail -n 4))
+ rec_list=($(awk '/9_sub.*record/ { print $((NF-3)) }' /$TMP/$tfile |
+ tail -n 4))
+ #remount mgs as ldiskfs or zfs type
+ stop mgs || error "stop mgs failed"
+ mount_fstype mgs || error "remount mgs failed"
+ for ((i = 0; i < ${#fid_list[@]}; i++)); do
+ fid=${fid_list[i]}
+ rec=${rec_list[i]}
+ seq=$(echo $fid | awk -F ':' '{ print $1 }' | sed -e "s/^0x//g")
+ oid=$(echo $fid | awk -F ':' '{ print $2 }' | sed -e "s/^0x//g")
+ oid=$((16#$oid))
+
+ case $fstype in
+ ldiskfs )
+ obj_file=$mntpt/O/$seq/d$((oid%32))/$oid ;;
+ zfs )
+ obj_file=$mntpt/oi.$(($((16#$seq))&127))/$fid ;;
+ esac
+ echo "obj_file is $obj_file"
+ do_facet mgs $llog_reader $obj_file
+
+ rec_type=$(do_facet mgs $llog_reader $obj_file | grep "type=" |
+ awk '{ print $3 }' | sed -e "s/^type=//g")
+ if [ $rec_type != $rec ]; then
+ echo "FAILED test_60a wrong record type $rec_type," \
+ "should be $rec"
+ pass=false
+ break
+ fi
+
+ #check obj path if record type is LLOG_LOGID_MAGIC
+ if [ "$rec" == "1064553b" ]; then
+ path=$(do_facet mgs $llog_reader $obj_file |
+ grep "path=" | awk '{ print $NF }' |
+ sed -e "s/^path=//g")
+ if [ $obj_file != $mntpt/$path ]; then
+ echo "FAILED test_60a wrong obj path" \
+ "$montpt/$path, should be $obj_file"
+ pass=false
+ break
+ fi
+ fi
+ done
+ rm -f $TMP/$tfile
+ #restart mgs before "error", otherwise it will block the next test
+ stop mgs || error "stop mgs failed"
+ start mgs $(mgsdevname) $MGS_MOUNT_OPTS || error "start mgs failed"
+ $pass || error "test failed, see FAILED test_60a messages for specifics"
}
-run_test 60a "llog sanity tests run from kernel module =========="
+run_test 60a "llog_test run from kernel module and test llog_reader =========="
test_60b() { # bug 6411
[ $PARALLEL == "yes" ] && skip "skip parallel run" && return
}
run_test 60d "test printk console message masking"
+test_60e() {
+ [ $PARALLEL == "yes" ] && skip "skip parallel run" && return
+ touch $DIR/$tfile
+#define OBD_FAIL_MDS_LLOG_CREATE_FAILED2 0x15b
+ do_facet mds1 lctl set_param fail_loc=0x15b
+ rm $DIR/$tfile
+}
+run_test 60e "no space while new llog is being created"
+
test_61() {
[ $PARALLEL == "yes" ] && skip "skip parallel run" && return
f="$DIR/f61"
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
run_test 68b "support swapping to Lustre ========================"
# bug5265, obdfilter oa2dentry return -ENOENT
-# #define OBD_FAIL_OST_ENOENT 0x217
+# #define OBD_FAIL_SRV_ENOENT 0x217
test_69() {
[ $PARALLEL == "yes" ] && skip "skip parallel run" && return
remote_ost_nodsh && skip "remote OST with nodsh" && return
local xsize=${1:-1024} # in bytes
local file=$DIR/$tfile
- [ -z $(lctl get_param -n mdc.*.connect_flags | grep xattr) ] &&
+ [ -z "$(lctl get_param -n mdc.*.connect_flags | grep xattr)" ] &&
skip "must have user_xattr" && return 0
[ -z "$(which setfattr 2>/dev/null)" ] &&
skip_env "could not find setfattr" && return 0
reset_async
- #define OBD_FAIL_OST_ENOENT 0x217
+ #define OBD_FAIL_SRV_ENOENT 0x217
set_nodes_failloc "$(osts_nodes)" 0x217
$MULTIOP $DIR/$tfile oO_CREAT:O_RDWR:O_SYNC:w4096c
RC=$?
do_facet $facet "test -e $LDPROC/$canondev/max_dir_size" ||
LDPROC=/sys/fs/ldiskfs
do_facet $facet "echo $1 >$LDPROC/$canondev/max_dir_size"
+ do_facet $facet "test -e $LDPROC/$canondev/warning_dir_size" ||
+ LDPROC=/sys/fs/ldiskfs
+ do_facet $facet "echo $2 >$LDPROC/$canondev/warning_dir_size"
done
}
+check_mds_dmesg() {
+ local facets=$(get_facets MDS)
+ for facet in ${facets//,/ }; do
+ do_facet $facet "dmesg | tail -3 | grep -q $1" && return 0
+ done
+ return 1
+}
+
test_129() {
[ $PARALLEL == "yes" ] && skip "skip parallel run" && return
if [ "$(facet_fstype $SINGLEMDS)" != ldiskfs ]; then
remote_mds_nodsh && skip "remote MDS with nodsh" && return
ENOSPC=28
EFBIG=27
+ has_warning=0
rm -rf $DIR/$tdir
test_mkdir -p $DIR/$tdir
# block size of mds1
local MDT_DEV=$(mdsdevname ${SINGLEMDS//mds/})
local MDSBLOCKSIZE=$($LCTL get_param -n mdc.*MDT0000*.blocksize)
- local MAX=$((MDSBLOCKSIZE * 3))
- set_dir_limits $MAX
+ local MAX=$((MDSBLOCKSIZE * 5))
+ set_dir_limits $MAX $MAX
local I=$(stat -c%s "$DIR/$tdir")
local J=0
local STRIPE_COUNT=1
while [[ $I -le $MAX ]]; do
$MULTIOP $DIR/$tdir/$J Oc
rc=$?
+ if [ $has_warning -eq 0 ]; then
+ check_mds_dmesg '"is approaching"' &&
+ has_warning=1
+ fi
#check two errors ENOSPC for new version of ext4 max_dir_size patch
#mainline kernel commit df981d03eeff7971ac7e6ff37000bfa702327ef1
#and EFBIG for previous versions
if [ $rc -eq $EFBIG -o $rc -eq $ENOSPC ]; then
- set_dir_limits 0
+ set_dir_limits 0 0
echo "return code $rc received as expected"
multiop $DIR/$tdir/$J Oc ||
error_exit "multiop failed w/o dir size limit"
+ check_mds_dmesg '"has reached"' ||
+ error_exit "has reached message should be output"
+
+ [ $has_warning ] ||
+ error_exit "warning message should be output"
+
I=$(stat -c%s "$DIR/$tdir")
if [ $(lustre_version_code $SINGLEMDS) -lt \
fi
error_exit "current dir size $I, previous limit $MAX"
elif [ $rc -ne 0 ]; then
- set_dir_limits 0
+ set_dir_limits 0 0
error_exit "return code $rc received instead of expected " \
"$EFBIG or $ENOSPC, files in dir $I"
fi
I=$(stat -c%s "$DIR/$tdir")
done
- set_dir_limits 0
+ set_dir_limits 0 0
error "exceeded dir size limit $MAX($MDSCOUNT) : $I bytes"
}
run_test 129 "test directory size limit ========================"
rm $DIR/$tdir/m
unlinkmany $DIR/$tdir/f $nr
}
-run_test 134a "Server reclaims locks when reaching low watermark"
+run_test 134a "Server reclaims locks when reaching lock_reclaim_threshold"
test_134b() {
[[ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.7.54) ]] &&
mkdir -p $DIR/$tdir || error "failed to create $DIR/$tdir"
cancel_lru_locks mdc
- local low_wm=$(do_facet mds1 $LCTL get_param -n ldlm.watermark_mb_low)
+ local low_wm=$(do_facet mds1 $LCTL get_param -n \
+ ldlm.lock_reclaim_threshold_mb)
# disable reclaim temporarily
- do_facet mds1 $LCTL set_param ldlm.watermark_mb_low=0
+ do_facet mds1 $LCTL set_param ldlm.lock_reclaim_threshold_mb=0
#define OBD_FAIL_LDLM_WATERMARK_HIGH 0x328
do_facet mds1 $LCTL set_param fail_loc=0x328
if ! ps -p $create_pid > /dev/null 2>&1; then
do_facet mds1 $LCTL set_param fail_loc=0
do_facet mds1 $LCTL set_param fail_val=0
- do_facet mds1 $LCTL set_param ldlm.watermark_mb_low=$low_wm
+ do_facet mds1 $LCTL set_param \
+ ldlm.lock_reclaim_threshold_mb=${low_wm}m
error "createmany finished incorrectly!"
fi
do_facet mds1 $LCTL set_param fail_loc=0
do_facet mds1 $LCTL set_param fail_val=0
- do_facet mds1 $LCTL set_param ldlm.watermark_mb_low=$low_wm
+ do_facet mds1 $LCTL set_param ldlm.lock_reclaim_threshold_mb=${low_wm}m
wait $create_pid || return 1
unlinkmany $DIR/$tdir/f $nr
}
-run_test 134b "Server rejects lock request when reaching high watermark"
+run_test 134b "Server rejects lock request when reaching lock_limit_mb"
test_140() { #bug-17379
[ $PARALLEL == "yes" ] && skip "skip parallel run" && return
}
run_test 160c "verify that changelog log catch the truncate event"
+test_160d() {
+ remote_mds_nodsh && skip "remote MDS with nodsh" && return
+ [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return
+
+ local server_version=$(lustre_version_code mds1)
+ local CL_MASK_PARAM="mdd.$MDT0.changelog_mask"
+
+ [[ $server_version -ge $(version_code 2.7.60) ]] ||
+ { skip "Need MDS version at least 2.7.60+"; return; }
+ [ $PARALLEL == "yes" ] && skip "skip parallel run" && return
+
+ # Registration step
+ local USER=$(do_facet mds1 $LCTL --device $MDT0 \
+ changelog_register -n)
+
+ mkdir -p $DIR/$tdir/migrate_dir
+ $LFS changelog_clear $MDT0 $USER 0
+
+ $LFS migrate -m 1 $DIR/$tdir/migrate_dir || error "migrate fails"
+ $LFS changelog $MDT0
+ MIGRATES=$($LFS changelog $MDT0 | tail -5 | grep -c "MIGRT")
+ $LFS changelog_clear $MDT0 $USER 0
+ [ $MIGRATES -eq 1 ] ||
+ error "MIGRATE changelog mask count $MIGRATES != 1"
+
+ # Deregistration step
+ do_facet mds1 $LCTL --device $MDT0 changelog_deregister $USER
+}
+run_test 160d "verify that changelog log catch the migrate event"
+
test_161a() {
[ $PARALLEL == "yes" ] && skip "skip parallel run" && return
test_mkdir -p -c1 $DIR/$tdir
echo "fid $fid resolves to path $path (expected $expected)"
}
-test_162() {
+test_162a() { # was test_162
# Make changes to filesystem
[ $PARALLEL == "yes" ] && skip "skip parallel run" && return
test_mkdir -p -c1 $DIR/$tdir/d2
return 0
}
-run_test 162 "path lookup sanity"
+run_test 162a "path lookup sanity"
test_162b() {
[ $PARALLEL == "yes" ] && skip "skip parallel run" && return
elif [ -n "$JOB_ID" ]; then # Sun Grid Engine
JOBENV=JOB_ID
else
- JOBENV=FAKE_JOBID
+ $LCTL list_param jobid_name > /dev/null 2>&1
+ if [ $? -eq 0 ]; then
+ JOBENV=nodelocal
+ else
+ JOBENV=FAKE_JOBID
+ fi
fi
verify_jobstats() {
FAKE_JOBID=id.$testnum.$(basename ${cmd[0]}).$RANDOM
JOBVAL=${!JOBENV}
+
+ [ "$JOBENV" = "nodelocal" ] && {
+ FAKE_JOBID=id.$testnum.$(basename ${cmd[0]}).$RANDOM
+ $LCTL set_param jobid_name=$FAKE_JOBID
+ JOBVAL=$FAKE_JOBID
+ }
+
log "Test: ${cmd[*]}"
log "Using JobID environment variable $JOBENV=$JOBVAL"
cmd="mv -f $DIR/$tfile $DIR/$tdir.rename"
verify_jobstats "$cmd" "$SINGLEMDS"
# jobstats expiry - sleep until old stats should be expired
- local left=$((interval_new - (SECONDS - start)))
+ local left=$((interval_new + 2 - (SECONDS - start)))
[ $left -ge 0 ] && echo "sleep $left for expiry" && sleep $((left + 1))
cmd="mkdir $DIR/$tdir.expire"
verify_jobstats "$cmd" "$SINGLEMDS"
ln -s $other_dir/$tfile $migrate_dir/${tfile}_ln_other
$LFS migrate -m $MDTIDX $migrate_dir ||
- error "migrate remote dir error"
+ error "fails on migrating remote dir to MDT1"
echo "migratate to MDT1, then checking.."
for ((i = 0; i < 10; i++)); do
#migrate back to MDT0
MDTIDX=0
+
$LFS migrate -m $MDTIDX $migrate_dir ||
- error "migrate remote dir error"
+ error "fails on migrating remote dir to MDT0"
echo "migrate back to MDT0, checking.."
for file in $(find $migrate_dir); do
local t=$(ls $migrate_dir | wc -l)
$LFS migrate --mdt-index $MDTIDX $migrate_dir &&
error "migrate should fail after 5 entries"
+
+ mkdir $migrate_dir/dir &&
+ error "mkdir succeeds under migrating directory"
+ touch $migrate_dir/file &&
+ error "touch file succeeds under migrating directory"
+
local u=$(ls $migrate_dir | wc -l)
[ "$u" == "$t" ] || error "$u != $t during migration"
}
run_test 230d "check migrate big directory"
+test_230e() {
+ [ $PARALLEL == "yes" ] && skip "skip parallel run" && return
+ [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return
+ local i
+ local j
+ local a_fid
+ local b_fid
+
+ mkdir -p $DIR/$tdir
+ mkdir $DIR/$tdir/migrate_dir
+ mkdir $DIR/$tdir/other_dir
+ touch $DIR/$tdir/migrate_dir/a
+ ln $DIR/$tdir/migrate_dir/a $DIR/$tdir/other_dir/b
+ ls $DIR/$tdir/other_dir
+
+ $LFS migrate -m 1 $DIR/$tdir/migrate_dir ||
+ error "migrate dir fails"
+
+ mdt_index=$($LFS getstripe -M $DIR/$tdir/migrate_dir)
+ [ $mdt_index == 1 ] || error "migrate_dir is not on MDT1"
+
+ mdt_index=$($LFS getstripe -M $DIR/$tdir/migrate_dir/a)
+ [ $mdt_index == 0 ] || error "a is not on MDT0"
+
+ $LFS migrate -m 1 $DIR/$tdir/other_dir ||
+ error "migrate dir fails"
+
+ mdt_index=$($LFS getstripe -M $DIR/$tdir/other_dir)
+ [ $mdt_index == 1 ] || error "other_dir is not on MDT1"
+
+ mdt_index=$($LFS getstripe -M $DIR/$tdir/migrate_dir/a)
+ [ $mdt_index == 1 ] || error "a is not on MDT1"
+
+ mdt_index=$($LFS getstripe -M $DIR/$tdir/other_dir/b)
+ [ $mdt_index == 1 ] || error "b is not on MDT1"
+
+ a_fid=$($LFS path2fid $DIR/$tdir/migrate_dir/a)
+ b_fid=$($LFS path2fid $DIR/$tdir/other_dir/b)
+
+ [ "$a_fid" = "$b_fid" ] || error "different fid after migration"
+
+ rm -rf $DIR/$tdir || error "rm dir failed after migration"
+}
+run_test 230e "migrate mulitple local link files"
+
+test_230f() {
+ [ $PARALLEL == "yes" ] && skip "skip parallel run" && return
+ [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return
+ local a_fid
+ local ln_fid
+
+ mkdir -p $DIR/$tdir
+ mkdir $DIR/$tdir/migrate_dir
+ $LFS mkdir -i1 $DIR/$tdir/other_dir
+ touch $DIR/$tdir/migrate_dir/a
+ ln $DIR/$tdir/migrate_dir/a $DIR/$tdir/other_dir/ln1
+ ln $DIR/$tdir/migrate_dir/a $DIR/$tdir/other_dir/ln2
+ ls $DIR/$tdir/other_dir
+
+ # a should be migrated to MDT1, since no other links on MDT0
+ $LFS migrate -m 1 $DIR/$tdir/migrate_dir ||
+ error "migrate dir fails"
+ mdt_index=$($LFS getstripe -M $DIR/$tdir/migrate_dir)
+ [ $mdt_index == 1 ] || error "migrate_dir is not on MDT1"
+ mdt_index=$($LFS getstripe -M $DIR/$tdir/migrate_dir/a)
+ [ $mdt_index == 1 ] || error "a is not on MDT1"
+
+ # a should stay on MDT1, because it is a mulitple link file
+ $LFS migrate -m 0 $DIR/$tdir/migrate_dir ||
+ error "migrate dir fails"
+ mdt_index=$($LFS getstripe -M $DIR/$tdir/migrate_dir/a)
+ [ $mdt_index == 1 ] || error "a is not on MDT1"
+
+ $LFS migrate -m 1 $DIR/$tdir/migrate_dir ||
+ error "migrate dir fails"
+
+ a_fid=$($LFS path2fid $DIR/$tdir/migrate_dir/a)
+ ln_fid=$($LFS path2fid $DIR/$tdir/other_dir/ln1)
+ [ "$a_fid" = "$ln_fid" ] || error "different fid after migrate to MDT1"
+
+ rm -rf $DIR/$tdir/other_dir/ln1 || error "unlink ln1 fails"
+ rm -rf $DIR/$tdir/other_dir/ln2 || error "unlink ln2 fails"
+
+ # a should be migrated to MDT0, since no other links on MDT1
+ $LFS migrate -m 0 $DIR/$tdir/migrate_dir ||
+ error "migrate dir fails"
+ mdt_index=$($LFS getstripe -M $DIR/$tdir/migrate_dir/a)
+ [ $mdt_index == 0 ] || error "a is not on MDT0"
+
+ rm -rf $DIR/$tdir || error "rm dir failed after migration"
+}
+run_test 230f "migrate mulitple remote link files"
+
+test_230g() {
+ [ $PARALLEL == "yes" ] && skip "skip parallel run" && return
+ [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return
+
+ mkdir -p $DIR/$tdir/migrate_dir
+
+ $LFS migrate -m 1000 $DIR/$tdir/migrate_dir &&
+ error "migrating dir to non-exist MDT succeeds"
+ true
+}
+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"
}
run_test 239 "osp_sync test"
+test_239a() { #LU-5297
+ touch $DIR/$tfile
+ #define OBD_FAIL_OSP_CHECK_INVALID_REC 0x2100
+ do_facet $SINGLEMDS $LCTL set_param fail_loc=0x2100
+ chgrp $RUNAS_GID $DIR/$tfile
+ wait_delete_completed
+}
+run_test 239a "process invalid osp sync record correctly"
+
+test_239b() { #LU-5297
+ touch $DIR/$tfile1
+ #define OBD_FAIL_OSP_CHECK_ENOMEM 0x2101
+ do_facet $SINGLEMDS $LCTL set_param fail_loc=0x2101
+ chgrp $RUNAS_GID $DIR/$tfile1
+ wait_delete_completed
+ do_facet $SINGLEMDS $LCTL set_param fail_loc=0
+ touch $DIR/$tfile2
+ chgrp $RUNAS_GID $DIR/$tfile2
+ wait_delete_completed
+}
+run_test 239b "process osp sync record with ENOMEM error correctly"
+
test_240() {
[ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return
}
run_test 244 "sendfile with group lock tests"
+test_245() {
+ local flagname="multi_mod_rpcs"
+ local connect_data_name="max_mod_rpcs"
+ local out
+
+ # check if multiple modify RPCs flag is set
+ out=$($LCTL get_param mdc.$FSNAME-MDT0000-*.import |
+ grep "connect_flags:")
+ echo "$out"
+
+ echo "$out" | grep -qw $flagname
+ if [ $? -ne 0 ]; then
+ echo "connect flag $flagname is not set"
+ return
+ fi
+
+ # check if multiple modify RPCs data is set
+ out=$($LCTL get_param mdc.$FSNAME-MDT0000-*.import)
+ echo "$out"
+
+ echo "$out" | grep -qw $connect_data_name ||
+ error "import should have connect data $connect_data_name"
+}
+run_test 245 "check mdc connection flag/data: multiple modify RPCs"
+
+test_246() { # LU-7371
+ [ $(lustre_version_code ost1) -lt $(version_code 2.7.62) ] &&
+ skip "Need OST version >= 2.7.62" && return 0
+ do_facet ost1 $LCTL set_param fail_val=4095
+#define OBD_FAIL_OST_READ_SIZE 0x234
+ do_facet ost1 $LCTL set_param fail_loc=0x234
+ $LFS setstripe $DIR/$tfile -i 0 -c 1
+ dd if=/dev/zero of=$DIR/$tfile bs=4095 count=1 > /dev/null 2>&1
+ cancel_lru_locks $FSNAME-OST0000
+ dd if=$DIR/$tfile of=/dev/null bs=1048576 || error "Read failed"
+}
+run_test 246 "Read file of size 4095 should return right length"
+
test_250() {
[ "$(facet_fstype ost$(($($GETSTRIPE -i $DIR/$tfile) + 1)))" = "zfs" ] \
&& skip "no 16TB file size limit on ZFS" && return
}
run_test 251 "Handling short read and write correctly"
+test_252() {
+ local tgt
+ local dev
+ local out
+ local uuid
+ local num
+ local gen
+
+ if [ "$(facet_fstype ost1)" != "ldiskfs" -o \
+ "$(facet_fstype mds1)" != "ldiskfs" ]; then
+ skip "can only run lr_reader on ldiskfs target"
+ return
+ fi
+
+ # check lr_reader on OST0000
+ tgt=ost1
+ dev=$(facet_device $tgt)
+ out=$(do_facet $tgt $LR_READER $dev)
+ [ $? -eq 0 ] || error "$LR_READER failed on target $tgt device $dev"
+ echo "$out"
+ uuid=$(echo "$out" | grep -i uuid | awk '{ print $2 }')
+ [ "$uuid" == "$(ostuuid_from_index 0)" ] ||
+ error "Invalid uuid returned by $LR_READER on target $tgt"
+ echo -e "uuid returned by $LR_READER is '$uuid'\n"
+
+ # check lr_reader -c on MDT0000
+ tgt=mds1
+ dev=$(facet_device $tgt)
+ if ! do_facet $tgt $LR_READER -h | grep -q OPTIONS; then
+ echo "$LR_READER does not support additional options"
+ return 0
+ fi
+ out=$(do_facet $tgt $LR_READER -c $dev)
+ [ $? -eq 0 ] || error "$LR_READER failed on target $tgt device $dev"
+ echo "$out"
+ num=$(echo "$out" | grep -c "mdtlov")
+ [ "$num" -eq $((MDSCOUNT - 1)) ] ||
+ error "Invalid number of mdtlov clients returned by $LR_READER"
+ echo -e "Number of mdtlov clients returned by $LR_READER is '$num'\n"
+
+ # check lr_reader -cr on MDT0000
+ out=$(do_facet $tgt $LR_READER -cr $dev)
+ [ $? -eq 0 ] || error "$LR_READER failed on target $tgt device $dev"
+ echo "$out"
+ echo "$out" | grep -q "^reply_data:$" ||
+ error "$LR_READER should have returned 'reply_data' section"
+ num=$(echo "$out" | grep -c "client_generation")
+ echo -e "Number of reply data returned by $LR_READER is '$num'\n"
+}
+run_test 252 "check lr_reader tool"
+
+
cleanup_test_300() {
trap 0
umask $SAVE_UMASK
run_test 300d "check default stripe under striped directory"
test_300e() {
+ [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.7.55) ] &&
+ skip "Need MDS version at least 2.7.55" && return
[ $PARALLEL == "yes" ] && skip "skip parallel run" && return
[ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return
local stripe_count
run_test 300e "check rename under striped directory"
test_300f() {
+ [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.7.55) ] &&
+ skip "Need MDS version at least 2.7.55" && return
[ $PARALLEL == "yes" ] && skip "skip parallel run" && return
[ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return
local stripe_count
for dir in $(find $DIR/$tdir/$dirname/*); do
stripe_count=$($LFS getdirstripe -c $dir)
[ $stripe_count -eq $default_count ] ||
+ [ $stripe_count -eq 0 -o $default_count -eq 1 ] ||
error "stripe count $default_count != $stripe_count for $dir"
stripe_index=$($LFS getdirstripe -i $dir)
}
test_300g() {
+ [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.7.55) ] &&
+ skip "Need MDS version at least 2.7.55" && return
[ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return
local dir
local stripe_count
run_test 300g "check default striped directory for normal directory"
test_300h() {
+ [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.7.55) ] &&
+ skip "Need MDS version at least 2.7.55" && return
[ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return
local dir
local stripe_count
run_test 300h "check default striped directory for striped directory"
test_300i() {
+ [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.7.55) ] &&
+ skip "Need MDS version at least 2.7.55" && return
[ $PARALLEL == "yes" ] && skip "skip parallel run" && return
[ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return
local stripe_count
run_test 300j "test large update record"
test_300k() {
- [ $PARALLEL == "yes" ] && skip "skip parallel run" && return
[ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.7.55) ] &&
skip "Need MDS version at least 2.7.55" && return
+ [ $PARALLEL == "yes" ] && skip "skip parallel run" && return
[ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return
local stripe_count
local file
run_test 300k "test large striped directory"
test_300l() {
+ [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.7.55) ] &&
+ skip "Need MDS version at least 2.7.55" && return
[ $PARALLEL == "yes" ] && skip "skip parallel run" && return
[ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return
local stripe_index
}
run_test 300l "non-root user to create dir under striped dir with stale layout"
+test_300m() {
+ [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.7.55) ] &&
+ skip "Need MDS version at least 2.7.55" && return
+ [ $PARALLEL == "yes" ] && skip "skip parallel run" && return
+ [ $MDSCOUNT -ge 2 ] && skip "Only for single MDT" && return
+
+ mkdir -p $DIR/$tdir/striped_dir
+ $LFS setdirstripe -D -c 1 $DIR/$tdir/striped_dir ||
+ error "set default stripes dir error"
+
+ mkdir $DIR/$tdir/striped_dir/a || error "mkdir a fails"
+
+ stripe_count=$($LFS getdirstripe -c $DIR/$tdir/striped_dir/a)
+ [ $stripe_count -eq 0 ] ||
+ error "expect 0 get $stripe_count for a"
+
+ $LFS setdirstripe -D -c 2 $DIR/$tdir/striped_dir ||
+ error "set default stripes dir error"
+
+ mkdir $DIR/$tdir/striped_dir/b || error "mkdir b fails"
+
+ stripe_count=$($LFS getdirstripe -c $DIR/$tdir/striped_dir/b)
+ [ $stripe_count -eq 0 ] ||
+ error "expect 0 get $stripe_count for b"
+
+ $LFS setdirstripe -D -c1 -i2 $DIR/$tdir/striped_dir ||
+ error "set default stripes dir error"
+
+ mkdir $DIR/$tdir/striped_dir/c &&
+ error "default stripe_index is invalid, mkdir c should fails"
+
+ rm -rf $DIR/$tdir || error "rmdir fails"
+}
+run_test 300m "setstriped directory on single MDT FS"
+
+cleanup_300n() {
+ local list=$(comma_list $(mdts_nodes))
+
+ trap 0
+ do_nodes $list $LCTL set_param -n mdt.*.enable_remote_dir_gid=0
+}
+
+test_300n() {
+ [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.7.55) ] &&
+ skip "Need MDS version at least 2.7.55" && return
+ [ $PARALLEL == "yes" ] && skip "skip parallel run" && return
+ [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return
+ local stripe_index
+ local list=$(comma_list $(mdts_nodes))
+
+ trap cleanup_300n RETURN EXIT
+ mkdir -p $DIR/$tdir
+ chmod 777 $DIR/$tdir
+ $RUNAS $LFS setdirstripe -i0 -c$MDSCOUNT \
+ $DIR/$tdir/striped_dir > /dev/null 2>&1 &&
+ error "create striped dir succeeds with gid=0"
+
+ do_nodes $list $LCTL set_param -n mdt.*.enable_remote_dir_gid=-1
+ $RUNAS $LFS setdirstripe -i0 -c$MDSCOUNT $DIR/$tdir/striped_dir ||
+ error "create striped dir fails with gid=-1"
+
+ do_nodes $list $LCTL set_param -n mdt.*.enable_remote_dir_gid=0
+ $RUNAS $LFS setdirstripe -i 1 -c$MDSCOUNT -D \
+ $DIR/$tdir/striped_dir > /dev/null 2>&1 &&
+ error "set default striped dir succeeds with gid=0"
+
+
+ do_nodes $list $LCTL set_param -n mdt.*.enable_remote_dir_gid=-1
+ $RUNAS $LFS setdirstripe -i 1 -c$MDSCOUNT -D $DIR/$tdir/striped_dir ||
+ error "set default striped dir fails with gid=-1"
+
+
+ do_nodes $list $LCTL set_param -n mdt.*.enable_remote_dir_gid=0
+ $RUNAS mkdir $DIR/$tdir/striped_dir/test_dir ||
+ error "create test_dir fails"
+ $RUNAS mkdir $DIR/$tdir/striped_dir/test_dir1 ||
+ error "create test_dir1 fails"
+ $RUNAS mkdir $DIR/$tdir/striped_dir/test_dir2 ||
+ error "create test_dir2 fails"
+ cleanup_300n
+}
+run_test 300n "non-root user to create dir under striped dir with default EA"
+
+test_300o() {
+ [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.7.55) ] &&
+ skip "Need MDS version at least 2.7.55" && return
+ [ $PARALLEL == "yes" ] && skip "skip parallel run" && return
+ [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return
+ local numfree1
+ local numfree2
+
+ mkdir -p $DIR/$tdir
+
+ numfree1=$(lctl get_param -n mdc.*MDT0000*.filesfree)
+ numfree2=$(lctl get_param -n mdc.*MDT0001*.filesfree)
+ if [ $numfree1 -lt 66000 -o $numfree2 -lt 66000 ]; then
+ skip "not enough free inodes $numfree1 $numfree2"
+ return
+ fi
+
+ numfree1=$(lctl get_param -n mdc.*MDT0000-mdc-*.kbytesfree)
+ numfree2=$(lctl get_param -n mdc.*MDT0001-mdc-*.kbytesfree)
+ if [ $numfree1 -lt 300000 -o $numfree2 -lt 300000 ]; then
+ skip "not enough free space $numfree1 $numfree2"
+ return
+ fi
+
+ $LFS setdirstripe -c2 $DIR/$tdir/striped_dir ||
+ error "setdirstripe fails"
+
+ createmany -d $DIR/$tdir/striped_dir/d 131000 ||
+ error "create dirs fails"
+
+ $LCTL set_param ldlm.namespaces.*mdc-*.lru_size=0
+ ls $DIR/$tdir/striped_dir > /dev/null ||
+ error "ls striped dir fails"
+ unlinkmany -d $DIR/$tdir/striped_dir/d 131000 ||
+ error "unlink big striped dir fails"
+}
+run_test 300o "unlink big sub stripe(> 65000 subdirs)"
+
+test_300p() {
+ [ $PARALLEL == "yes" ] && skip "skip parallel run" && return
+ [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return
+
+ mkdir -p $DIR/$tdir
+
+ #define OBD_FAIL_OUT_ENOSPC 0x1704
+ do_facet mds2 lctl set_param fail_loc=0x80001704
+ $LFS setdirstripe -c2 $DIR/$tdir/bad_striped_dir > /dev/null 2>&1 &&
+ error "create striped directory should fail"
+
+ [ -e $DIR/$tdir/bad_striped_dir ] && error "striped dir exists"
+ true
+}
+run_test 300p "create striped directory without space"
+
prepare_remote_file() {
mkdir $DIR/$tdir/src_dir ||
error "create remote source failed"
}
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)
+ #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))
+
+ [ $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
#