# skipped tests: LU-8411 LU-9096 LU-9054 ..
ALWAYS_EXCEPT=" 407 253 312 $ALWAYS_EXCEPT"
+# skipped tests: LU-4684
+ALWAYS_EXCEPT=" 17n 160d 230 316 $ALWAYS_EXCEPT"
# Check Grants after these tests
GRANT_CHECK_LIST="$GRANT_CHECK_LIST 42a 42b 42c 42d 42e 63a 63b 64a 64b 64c"
}
run_test 27G "Clear OST pool from stripe"
+test_27H() {
+ [[ $(lustre_version_code $SINGLEMDS) -le $(version_code 2.11.53) ]] &&
+ skip "Need MDS version newer than 2.11.53"
+ [[ $OSTCOUNT -lt 3 ]] && skip_env "needs >= 3 OSTs"
+ test_mkdir $DIR/$tdir
+ $LFS setstripe -o 0 -o 2 $DIR/$tdir || error "setstripe failed"
+ touch $DIR/$tdir/$tfile
+ $LFS getstripe -c $DIR/$tdir/$tfile
+ [ $($LFS getstripe -c $DIR/$tdir/$tfile) -eq 2 ] ||
+ error "two-stripe file doesn't have two stripes"
+
+ dd if=/dev/zero of=$DIR/$tdir/$tfile bs=4k count=4 || error "dd failed"
+ $LFS getstripe -y $DIR/$tdir/$tfile
+ (( $($LFS getstripe -y $DIR/$tdir/$tfile |
+ egrep -c "l_ost_idx: [02]$") == "2" )) ||
+ error "expected l_ost_idx: [02]$ not matched"
+}
+run_test 27H "Set specific OSTs stripe"
+
# createtest also checks that device nodes are created and
# then visible correctly (#2091)
test_28() { # bug 2091
run_test 102h "grow xattr from inside inode to external block"
test_102ha() {
- large_xattr_enabled || skip_env "large_xattr disabled"
+ large_xattr_enabled || skip_env "ea_inode feature disabled"
grow_xattr $(max_xattr_size)
}
}
run_test 102s "getting nonexistent xattrs should fail"
+test_102t() {
+ [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.11.52) ] &&
+ skip "MDS needs to be at least 2.11.52"
+
+ local save="$TMP/$TESTSUITE-$TESTNAME.parameters"
+
+ save_lustre_params client "llite.*.xattr_cache" > $save
+
+ for cache in 0 1; do
+ lctl set_param llite.*.xattr_cache=$cache
+
+ for buf_size in 0 256; do
+ rm -f $DIR/$tfile
+ touch $DIR/$tfile || error "touch"
+ setfattr -n user.multiop $DIR/$tfile
+ $MULTIOP $DIR/$tfile oa$buf_size ||
+ error "cannot get zero length xattr value (buf_size = $buf_size)"
+ done
+ done
+
+ restore_lustre_params < $save
+}
+run_test 102t "zero length xattr values handled correctly"
+
run_acl_subtest()
{
$LUSTRE/tests/acl/run $LUSTRE/tests/acl/$1.test
proc_regexp="/{proc,sys}/{fs,sys,kernel/debug}/{lustre,lnet}/"
+# Some versions of find (4.5.11, 4.5.14) included in CentOS 7.3-7.5 do
+# not honor the -ignore_readdir_race option correctly. So we call
+# error_ignore() rather than error() in these cases. See LU-11152.
+error_133() {
+ if (find --version; do_facet mds1 find --version) |
+ grep -q '\b4\.5\.1[1-4]\b'; then
+ error_ignore LU-11152 "$@"
+ else
+ error "$@"
+ fi
+}
+
test_133f() {
# First without trusting modes.
local proc_dirs=$(eval \ls -d $proc_regexp 2>/dev/null)
-not -name force_lbug \
-not -name changelog_mask \
-exec badarea_io '{}' \; ||
- error "find $proc_dirs failed"
+ error_133 "find $proc_dirs failed"
}
run_test 133f "Check reads/writes of client lustre proc files with bad area io"
-not -name force_lbug \
-not -name changelog_mask \
-exec badarea_io '{}' \\\; ||
- error "$facet find $facet_proc_dirs failed"
+ error_133 "$facet find $facet_proc_dirs failed"
done
# remount the FS in case writes/reads /proc break the FS
}
run_test 271c "DoM: IO lock at open saves enqueue RPCs"
+cleanup_271def_tests() {
+ trap 0
+ rm -f $1
+}
+
+test_271d() {
+ [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.10.57) ] &&
+ skip "Need MDS version at least 2.10.57" && return
+
+ local dom=$DIR/$tdir/dom
+ local tmp=$TMP/$tfile
+ trap "cleanup_271def_tests $tmp" EXIT
+
+ mkdir -p $DIR/$tdir
+
+ $LFS setstripe -E 1024K -L mdt $DIR/$tdir
+
+ local mdtidx=$($GETSTRIPE -M $DIR/$tdir)
+ local facet=mds$((mdtidx + 1))
+
+ cancel_lru_locks mdc
+ dd if=/dev/urandom of=$tmp bs=1000 count=1
+ dd if=$tmp of=$dom bs=1000 count=1
+ cancel_lru_locks mdc
+
+ cat /etc/hosts >> $tmp
+ lctl set_param -n mdc.*.stats=clear
+
+ # append data to the same file it should update local page
+ echo "Append to the same page"
+ cat /etc/hosts >> $dom
+ local num=$(lctl get_param -n mdc.*.stats |
+ awk '/ost_read/ {print $2}')
+ local ra=$(lctl get_param -n mdc.*.stats |
+ awk '/req_active/ {print $2}')
+ local rw=$(lctl get_param -n mdc.*.stats |
+ awk '/req_waittime/ {print $2}')
+
+ [ -z $num ] || error "$num READ RPC occured"
+ [ $ra == $rw ] || error "$((ra - rw)) resend occured"
+ echo "... DONE"
+
+ # compare content
+ cmp $tmp $dom || error "file miscompare"
+
+ cancel_lru_locks mdc
+ lctl set_param -n mdc.*.stats=clear
+
+ echo "Open and read file"
+ cat $dom > /dev/null
+ local num=$(lctl get_param -n mdc.*.stats |
+ awk '/ost_read/ {print $2}')
+ local ra=$(lctl get_param -n mdc.*.stats |
+ awk '/req_active/ {print $2}')
+ local rw=$(lctl get_param -n mdc.*.stats |
+ awk '/req_waittime/ {print $2}')
+
+ [ -z $num ] || error "$num READ RPC occured"
+ [ $ra == $rw ] || error "$((ra - rw)) resend occured"
+ echo "... DONE"
+
+ # compare content
+ cmp $tmp $dom || error "file miscompare"
+
+ return 0
+}
+run_test 271d "DoM: read on open (1K file in reply buffer)"
+
+test_271e() {
+ [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.10.57) ] &&
+ skip "Need MDS version at least 2.10.57" && return
+
+ local dom=$DIR/$tdir/dom
+ local tmp=$TMP/${tfile}.data
+ trap "cleanup_271def_tests $tmp" EXIT
+
+ mkdir -p $DIR/$tdir
+
+ $LFS setstripe -E 1024K -L mdt $DIR/$tdir
+
+ local mdtidx=$($GETSTRIPE -M $DIR/$tdir)
+ local facet=mds$((mdtidx + 1))
+
+ cancel_lru_locks mdc
+ dd if=/dev/urandom of=$tmp bs=30K count=1
+ dd if=$tmp of=$dom bs=30K count=1
+ cancel_lru_locks mdc
+ cat /etc/hosts >> $tmp
+ lctl set_param -n mdc.*.stats=clear
+
+ echo "Append to the same page"
+ cat /etc/hosts >> $dom
+
+ local num=$(lctl get_param -n mdc.*.stats | \
+ awk '/ost_read/ {print $2}')
+ local ra=$(lctl get_param -n mdc.*.stats | \
+ awk '/req_active/ {print $2}')
+ local rw=$(lctl get_param -n mdc.*.stats | \
+ awk '/req_waittime/ {print $2}')
+
+ [ -z $num ] || error "$num READ RPC occured"
+ # Reply buffer can be adjusted for larger buffer by resend
+ echo "... DONE with $((ra - rw)) resends"
+
+ # compare content
+ cmp $tmp $dom || error "file miscompare"
+
+ cancel_lru_locks mdc
+ lctl set_param -n mdc.*.stats=clear
+
+ echo "Open and read file"
+ cat $dom > /dev/null
+ local num=$(lctl get_param -n mdc.*.stats | \
+ awk '/ost_read/ {print $2}')
+ local ra=$(lctl get_param -n mdc.*.stats | \
+ awk '/req_active/ {print $2}')
+ local rw=$(lctl get_param -n mdc.*.stats | \
+ awk '/req_waittime/ {print $2}')
+
+ [ -z $num ] || error "$num READ RPC occured"
+ # Reply buffer can be adjusted for larger buffer by resend
+ echo "... DONE with $((ra - rw)) resends"
+
+ # compare content
+ cmp $tmp $dom || error "file miscompare"
+
+ return 0
+}
+run_test 271e "DoM: read on open (30K file with reply buffer adjusting)"
+
+test_271f() {
+ [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.10.57) ] &&
+ skip "Need MDS version at least 2.10.57" && return
+
+ local dom=$DIR/$tdir/dom
+ local tmp=$TMP/$tfile
+ trap "cleanup_271def_tests $tmp" EXIT
+
+ mkdir -p $DIR/$tdir
+
+ $LFS setstripe -E 1024K -L mdt $DIR/$tdir
+
+ local mdtidx=$($GETSTRIPE -M $DIR/$tdir)
+ local facet=mds$((mdtidx + 1))
+
+ cancel_lru_locks mdc
+ dd if=/dev/urandom of=$tmp bs=200000 count=1
+ dd if=$tmp of=$dom bs=200000 count=1
+ cancel_lru_locks mdc
+ cat /etc/hosts >> $tmp
+ lctl set_param -n mdc.*.stats=clear
+
+ echo "Append to the same page"
+ cat /etc/hosts >> $dom
+ local num=$(lctl get_param -n mdc.*.stats | \
+ awk '/ost_read/ {print $2}')
+ local ra=$(lctl get_param -n mdc.*.stats | \
+ awk '/req_active/ {print $2}')
+ local rw=$(lctl get_param -n mdc.*.stats | \
+ awk '/req_waittime/ {print $2}')
+
+ [ -z $num ] || error "$num READ RPC occured"
+ [ $ra == $rw ] || error "$((ra - rw)) resend occured"
+ echo "... DONE"
+
+ # compare content
+ cmp $tmp $dom || error "file miscompare"
+
+ cancel_lru_locks mdc
+ lctl set_param -n mdc.*.stats=clear
+
+ echo "Open and read file"
+ cat $dom > /dev/null
+ local num=$(lctl get_param -n mdc.*.stats | \
+ awk '/ost_read/ {print $2}')
+ local ra=$(lctl get_param -n mdc.*.stats | \
+ awk '/req_active/ {print $2}')
+ local rw=$(lctl get_param -n mdc.*.stats | \
+ awk '/req_waittime/ {print $2}')
+
+ [ $num -eq 1 ] || error "expect 1 READ RPC, $num occured"
+ [ $ra == $rw ] || error "$((ra - rw)) resend occured"
+ echo "... DONE"
+
+ # compare content
+ cmp $tmp $dom || error "file miscompare"
+
+ return 0
+}
+run_test 271f "DoM: read on open (200K file and read tail)"
+
test_275() {
remote_ost_nodsh && skip "remote OST with nodsh"
[ $(lustre_version_code ost1) -lt $(version_code 2.10.57) ] &&
test_316() {
[ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs"
- large_xattr_enabled || skip_env "large_xattr disabled"
+ large_xattr_enabled || skip_env "ea_inode feature disabled"
rm -rf $DIR/$tdir/d
mkdir -p $DIR/$tdir/d
}
run_test 414 "simulate ENOMEM in ptlrpc_register_bulk()"
+test_415() {
+ [ $PARALLEL == "yes" ] && skip "skip parallel run"
+ [ $(lustre_version_code mds1) -lt $(version_code 2.11.52) ] &&
+ skip "Need server version at least 2.11.52"
+
+ # LU-11102
+ local total
+ local setattr_pid
+ local start_time
+ local end_time
+ local duration
+
+ total=500
+ # this test may be slow on ZFS
+ [ "$(facet_fstype mds1)" == "zfs" ] && total=100
+
+ # though this test is designed for striped directory, let's test normal
+ # directory too since lock is always saved as CoS lock.
+ test_mkdir $DIR/$tdir || error "mkdir $tdir"
+ createmany -o $DIR/$tdir/$tfile. $total || error "createmany"
+
+ (
+ while true; do
+ touch $DIR/$tdir
+ done
+ ) &
+ setattr_pid=$!
+
+ start_time=$(date +%s)
+ for i in $(seq $total); do
+ mrename $DIR/$tdir/$tfile.$i $DIR/$tdir/$tfile-new.$i \
+ > /dev/null
+ done
+ end_time=$(date +%s)
+ duration=$((end_time - start_time))
+
+ kill -9 $setattr_pid
+
+ echo "rename $total files took $duration sec"
+ [ $duration -lt 100 ] || error "rename took $duration sec"
+}
+run_test 415 "lock revoke is not missing"
+
prep_801() {
[[ $(lustre_version_code mds1) -lt $(version_code 2.9.55) ]] ||
[[ $(lustre_version_code ost1) -lt $(version_code 2.9.55) ]] &&
[[ $(lustre_version_code ost1) -lt $(version_code 2.9.55) ]] &&
skip "Need server version at least 2.9.55"
+ [[ $ENABLE_QUOTA ]] && skip "Quota enabled for read-only test"
+
mkdir $DIR/$tdir || error "(1) fail to mkdir"
cp $LUSTRE/tests/test-framework.sh $DIR/$tdir/ ||
}
run_test 806 "Verify Lazy Size on MDS"
+test_807() {
+ [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.11.52) ] &&
+ skip "Need MDS version at least 2.11.52" && return
+
+ # Registration step
+ changelog_register || error "changelog_register failed"
+ local cl_user="${CL_USERS[$SINGLEMDS]%% *}"
+ changelog_users $SINGLEMDS | grep -q $cl_user ||
+ error "User $cl_user not found in changelog_users"
+
+ local save="$TMP/$TESTSUITE-$TESTNAME.parameters"
+ save_lustre_params client "llite.*.xattr_cache" > $save
+ lctl set_param llite.*.xattr_cache=0
+ stack_trap "restore_lustre_params < $save" EXIT
+
+ rm -rf $DIR/$tdir || error "rm $tdir failed"
+ mkdir -p $DIR/$tdir || error "mkdir $tdir failed"
+ touch $DIR/$tdir/trunc || error "touch $tdir/trunc failed"
+ $TRUNCATE $DIR/$tdir/trunc 1024 || error "truncate $tdir/trunc failed"
+ $TRUNCATE $DIR/$tdir/trunc 1048576 ||
+ error "truncate $tdir/trunc failed"
+
+ local bs=1048576
+ dd if=/dev/zero of=$DIR/$tdir/single_dd bs=$bs count=1 ||
+ error "write $tfile failed"
+
+ # multi-client wirtes
+ local num=$(get_node_count ${CLIENTS//,/ })
+ local offset=0
+ local i=0
+
+ echo "Test SOM for muti-client ($num) writes"
+ touch $DIR/$tfile || error "touch $tfile failed"
+ $TRUNCATE $DIR/$tfile 0
+ for client in ${CLIENTS//,/ }; do
+ do_node $client $MULTIOP $DIR/$tfile Oz${offset}w${bs}c &
+ local pids[$i]=$!
+ i=$((i + 1))
+ offset=$((offset + $bs))
+ done
+ for (( i=0; i < $num; i++ )); do
+ wait ${pids[$i]}
+ done
+
+ sleep 5
+ $LSOM_SYNC -u $cl_user -m $FSNAME-MDT0000 $MOUNT
+ check_lsom_data $DIR/$tdir/trunc
+ check_lsom_data $DIR/$tdir/single_dd
+ check_lsom_data $DIR/$tfile
+
+ rm -rf $DIR/$tdir
+ # Deregistration step
+ changelog_deregister || error "changelog_deregister failed"
+}
+run_test 807 "verify LSOM syncing tool"
+
#
# tests that do cleanup/setup should be run at the end
#