OPT_POOL=""
OPT_RESTRIPE=false
OPT_YES=false
-LFS_OPT_DIRECTIO=""
OPT_AUTOSTRIPE=false
OPT_STRIPE_COUNT=""
OPT_STRIPE_SIZE=""
-v|--verbose) OPT_DEBUG=true; ECHO=echo;;
-y|--yes) OPT_YES=true;;
-0) OPT_NULL=true;;
- -b|--block|--non-block|--non-direct|--no-verify)
+ -b|--block|--non-block|--non-direct|-D|--no-verify)
# Always pass non-layout options to 'lfs migrate'
OPT_PASSTHROUGH+=("$arg");;
--rsync) OPT_RSYNC=true;;
OPT_LAYOUT+="$arg $2 "; shift;;
--auto-stripe|-A) OPT_AUTOSTRIPE=true;;
-C) OPT_CAP="$2"; shift;;
- -D) LFS_OPT_DIRECTIO="-D";;
-M|--min-free) OPT_MINFREE="$2"; shift;;
-X|--max-free) OPT_MAXFREE="$2"; shift;;
-c|--stripe-count) OPT_STRIPE_COUNT="$2"; shift;;
# first try to migrate via Lustre tools, then fall back to rsync
if ! $OPT_RSYNC; then
+ $OPT_DEBUG && echo -e "\n$LFS migrate $layout $OLDNAME"
if $LFS migrate $layout "$OLDNAME"; then
$ECHO "done"
# no-op if hlinks empty for 1-link files
}
run_test 56wd "check lfs_migrate --rsync and --no-rsync work"
+test_56we() {
+ local td=$DIR/$tdir
+ local tf=$td/$tfile
+
+ test_mkdir $td || error "cannot create $td"
+ touch $tf || error "cannot touch $tf"
+
+ echo -n "Make sure --non-direct|-D works..."
+ $LFS_MIGRATE -y --non-direct -v $tf 2>&1 |
+ grep -q "lfs migrate --non-direct" ||
+ error "--non-direct option cannot work correctly"
+ $LFS_MIGRATE -y -D -v $tf 2>&1 |
+ grep -q "lfs migrate -D" ||
+ error "-D option cannot work correctly"
+ echo "done."
+}
+run_test 56we "check lfs_migrate --non-direct|-D support"
+
test_56x() {
[[ $OSTCOUNT -lt 2 ]] && skip_env "needs >= 2 OSTs"
check_swap_layouts_support