$LFS setstripe -S 65536 $DIR/$tdir/f0 || error "setstripe failed"
[ $($LFS getstripe -S $DIR/$tdir/f0) -ne 65536 ] &&
error "stripe size $size != 65536" || true
- [ $($LFS getstripe -d $DIR/$tdir | grep -c "stripe_count") -ne 1 ] &&
- error "$LFS getstripe -d $DIR/$tdir failed" || true
+ [ $($LFS getstripe -d $DIR/$tdir | grep -c "stripe_count") -eq 0 ] &&
+ error "$LFS getstripe -d $DIR/$tdir no 'stripe_count'" || true
}
-run_test 27w "check $LFS setstripe -S option"
+run_test 27w "check $LFS setstripe -S and getstrip -d options"
test_27wa() {
[[ $OSTCOUNT -lt 2 ]] &&
done
cd $DIR
- $1 $TAR cf $TMP/f102.tar $tdir --xattrs
+ $1 tar cf $TMP/f102.tar $tdir --xattrs
}
cleanup_test102() {
return 0
}
-find_lustre_tar() {
- [ -n "$(which tar 2>/dev/null)" ] &&
- strings $(which tar) | grep -q "lustre" && echo tar
+have_xattrs_include() {
+ tar --help | grep -q xattrs-include &&
+ echo --xattrs-include="lustre.*"
}
test_102d() {
[ $PARALLEL == "yes" ] && skip "skip parallel run" && return
- # b10930: tar test for trusted.lov xattr
- TAR=$(find_lustre_tar)
- [ -z "$TAR" ] && skip_env "lustre-aware tar is not installed" && return
[[ $OSTCOUNT -lt 2 ]] && skip_env "needs >= 2 OSTs" && return
+ XINC=$(have_xattrs_include)
setup_test102
- test_mkdir $DIR/$tdir
- $TAR xf $TMP/$tfile.tar -C $DIR/$tdir --xattrs
+ tar xf $TMP/f102.tar -C $DIR/$tdir --xattrs $XINC
cd $DIR/$tdir/$tdir
compare_stripe_info1
}
test_102f() {
[ $PARALLEL == "yes" ] && skip "skip parallel run" && return
- # b10930: tar test for trusted.lov xattr
- TAR=$(find_lustre_tar)
- [ -z "$TAR" ] && skip_env "lustre-aware tar is not installed" && return
[[ $OSTCOUNT -lt 2 ]] && skip_env "needs >= 2 OSTs" && return
+ XINC=$(have_xattrs_include)
setup_test102
test_mkdir $DIR/$tdir.restore
cd $DIR
- $TAR cf - --xattrs $tdir | $TAR xf - --xattrs -C $DIR/$tdir.restore
+ tar cf - --xattrs $tdir | tar xf - \
+ -C $DIR/$tdir.restore --xattrs $XINC
cd $DIR/$tdir.restore/$tdir
compare_stripe_info1
}
test_102j() {
[ $PARALLEL == "yes" ] && skip "skip parallel run" && return
- TAR=$(find_lustre_tar)
- [ -z "$TAR" ] && skip_env "lustre-aware tar is not installed" && return
[[ $OSTCOUNT -lt 2 ]] && skip_env "needs >= 2 OSTs" && return
+ XINC=$(have_xattrs_include)
setup_test102 "$RUNAS"
- test_mkdir $DIR/$tdir
chown $RUNAS_ID $DIR/$tdir
- $RUNAS $TAR xf $TMP/f102.tar -C $DIR/$tdir --xattrs
+ $RUNAS tar xf $TMP/f102.tar -C $DIR/$tdir --xattrs $XINC
cd $DIR/$tdir/$tdir
compare_stripe_info1 "$RUNAS"
}
# having "abc" as 1st arg, creates $TMP/lnet_abc.out and $TMP/lnet_abc.sys
create_lnet_proc_files() {
- lctl get_param -n $1 >$TMP/lnet_$1.out || error "cannot read lnet.$1"
- sysctl lnet.$1 >$TMP/lnet_$1.sys_tmp || error "cannot read lnet.$1"
-
- sed "s/^lnet.$1\ =\ //g" "$TMP/lnet_$1.sys_tmp" >$TMP/lnet_$1.sys
- rm -f "$TMP/lnet_$1.sys_tmp"
+ lctl get_param -n $1 >$TMP/lnet_$1.sys || error "cannot read lnet.$1"
}
# counterpart of create_lnet_proc_files
remove_lnet_proc_files() {
- rm -f $TMP/lnet_$1.out $TMP/lnet_$1.sys
+ rm -f $TMP/lnet_$1.sys
}
# uses 1st arg as trailing part of filename, 2nd arg as description for reports,
# can we successfully write to lnet.stats?
lctl set_param -n stats=0 || error "cannot write to lnet.stats"
- sysctl -w lnet.stats=0 || error "cannot write to lnet.stats"
}
run_test 215 "lnet exists and has proper content - bugs 18102, 21079, 21517"
#after mount new plainllog is used
touch $DIR/$tdir/{11..19}
- local TEMP256FILE=$(mktemp TEMP256XXXXXX)
+ do_facet mds1 sync
+ local TEMP256FILE=$(mktemp -u TEMP256XXXXXX)
cat_sl=$(do_facet mds1 \
"$DEBUGFS -R \\\"dump changelog_catalog $TEMP256FILE\\\" $mdt_dev; \
llog_reader $TEMP256FILE | grep \\\"type=1064553b\\\" | wc -l")
- rm $TEMP256FILE
+ do_facet mds1 rm $TEMP256FILE
if (( cat_sl != 2 )); then
do_facet mds1 $LCTL --device $MDT0 changelog_deregister $cl_user
$LFS changelog_clear $MDT0 $cl_user 0
- TEMP256FILE=$(mktemp TEMP256XXXXXX)
+ do_facet mds1 sync
+ TEMP256FILE=$(mktemp -u TEMP256XXXXXX)
cat_sl=$(do_facet mds1 \
"$DEBUGFS -R \\\"dump changelog_catalog $TEMP256FILE\\\" $mdt_dev; \
llog_reader $TEMP256FILE | grep \\\"type=1064553b\\\" | wc -l")
- rm $TEMP256FILE
+ do_facet mds1 rm $TEMP256FILE
do_facet mds1 $LCTL --device $MDT0 changelog_deregister $cl_user
$LFS setdirstripe -D -i1 $DIR/$tdir/striped_dir ||
error "create striped_dir failed"
+ $LFS setdirstripe -i0 $DIR/$tdir/striped_dir/dir0 ||
+ error "create dir0 fails"
+ stripe_index=$($LFS getdirstripe -i $DIR/$tdir/striped_dir/dir0)
+ [ $stripe_index -eq 0 ] ||
+ error "dir0 expect index 0 got $stripe_index"
+
mkdir $DIR/$tdir/striped_dir/dir1 ||
error "create dir1 fails"
stripe_index=$($LFS getdirstripe -i $DIR/$tdir/striped_dir/dir1)
[ $stripe_index -eq 1 ] ||
- error "dir1 expect 1 got $stripe_index"
-
- $LFS setdirstripe -i2 $DIR/$tdir/striped_dir/dir2 ||
- error "create dir2 fails"
- stripe_index=$($LFS getdirstripe -i $DIR/$tdir/striped_dir/dir2)
- [ $stripe_index -eq 2 ] ||
- error "dir2 expect 2 got $stripe_index"
+ error "dir1 expect index 1 got $stripe_index"
#check default stripe count/stripe index
test_300_check_default_striped_dir normal_dir $MDSCOUNT 1